I might have some more information for ya...
As I mentioned, I'm using the yaf email queue to send blog comment notificaitons and was getting the same thing you posted about - and we both were thinking it's a language thing. Well, it's not a language thing for my tests, it's the text encoding.
My emails showed the same kind of thing as yours:
Quote:ഀ䄀 渀攀眀 挀漀洀洀攀渀琀 栀愀猀 戀攀攀渀 瀀漀猀琀攀搀 琀漀㨀 栀琀琀瀀㨀⼀⼀氀漀挀愀氀栀漀猀琀⼀瀀漀爀琀愀氀⼀戀氀漀最猀⼀猀栀攀瀀⼀㈀ 㤀⼀ 㠀⼀ 㔀⼀吀栀椀猀ⴀ琀栀椀渀最ⴀ漀渀ഀഀ吀漀 猀琀漀瀀 戀攀椀渀最 渀漀琀椀昀椀攀搀 漀昀 渀攀眀 挀漀洀洀攀渀琀猀 琀漀 琀栀椀猀 戀氀漀最 瀀漀猀琀Ⰰ 漀瀀攀渀 琀栀攀 昀漀氀氀漀眀椀渀最 氀椀渀欀 椀渀 礀漀甀爀 戀爀漀眀猀攀爀㨀ഀഀ栀琀琀瀀㨀⼀⼀氀漀挀愀氀栀漀猀琀⼀瀀漀爀琀愀氀⼀戀氀漀最猀⼀猀栀攀瀀⼀㈀ 㤀⼀ 㠀⼀ 㔀⼀吀栀椀猀ⴀ琀栀椀渀最ⴀ漀渀㼀愀挀琀椀漀渀㴀甀渀猀甀戀猀挀爀椀戀攀☀攀洀愀椀氀㴀樀猀栀攀瀀氀攀爀─㐀 挀漀瀀瀀攀爀⸀渀攀琀ഀ
I got that from webmail. When downloaded to Outlook, it rendered the email correctly. Looking at the email headers, it has "Content-Type: text/plain; charset=utf-16".
So, I started digging into yaf code and came to the YAF.Classes.Utils.SendMail class. The Send(MailAddress, MailAddress, string, string, string) method is where all yaf email is sent from. This method sets the encoding to utf-8 and then looks at the first character of the subject and bodyText (not bodyHtml) to see if it should use utf-16 instead. It uses a regular expression and if the subject or bodyText start with a character that's not in the regular expression, it switches to utf-16. I would assume it would work just as well as utf-8, but I'm only a little familiar with text encoding.
In my tests, the email body I'm sending starts with a CRLF and so I think that's why it was sending as utf-16. Changing my test email to start with a "normal" character confirmed it. The email was sent in utf-8 and correctly rendered in webmail.
So, looking at english.xml, I see the PMNOTIFICATION_TEXT also starts with a CRLF (newline after the resource tag) and so those are probably being sent as utf-16.
I'm not sure what the proper fix would be, but I would think the regular expression should look for the first non-whitespace character to check. The .net regular expression parser counts CRLF as whitespace (and tabs too), so adding \s* after the ^ should work:
Code:if (!Regex.IsMatch(bodyText, @"^\s*([0-9a-z!@#\$\%\^&\*\(\)\-=_\+])", RegexOptions.IgnoreCase) ||
!Regex.IsMatch(subject, @"^\s*([0-9a-z!@#\$\%\^&\*\(\)\-=_\+])", RegexOptions.IgnoreCase))
{
textEncoding = Encoding.Unicode;
}
But that doesn't fix the rendering problem for when utf-16 actually needs to be sent. I don't know that there's anything yaf can do as it would be the client's (e.g. webmail or outlook) responsibility.
not jsheLPer