Posted by: mika_soukhov - Monday, 9 July 2012 15:39:24 |
---|
It seems that the code
[code=csharp]public static bool ContainsUnicodeCharacter(string input)
{
return input.ToCharArray().Any |
Posted by: Jaben - Thursday, 12 July 2012 05:49:53 |
---|
I cannot seem to find another reliable method. char is 2 bytes (so utf-16). This should work. |
Posted by: mika_soukhov - Friday, 13 July 2012 21:26:50 |
---|
[quote=Jaben;55444]I cannot seem to find another reliable method. char is 2 bytes (so utf-16). This should work. [/quote] It seems encoding issue doesn't related with UTF-16, cause html mails also sends as UTF-16, but it looks ok. BTW, I've fixed it by using html instead of plain text http://forum.yetanotherforum.net/yaf_postsm55427_Few-email-issues.aspx#post55427 |
Posted by: alpha6789 - Thursday, 19 July 2012 18:06:40 |
---|
[quote=mika_soukhov;55460][quote=Jaben;55444]I cannot seem to find another reliable method. char is 2 bytes (so utf-16). This should work. [/quote]
It seems encoding issue doesn't related with UTF-16, cause html mails also sends as UTF-16, but it looks ok. BTW, I've fixed it by using html instead of plain text http://forum.yetanotherforum.net/yaf_postsm55427_Few-email-issues.aspx#post55427[/quote]
I am using non-english culture and also facing the same issue. I also did the following modification
[i]public static bool ContainsUnicodeCharacter(string input)
{
return input.ToCharArray().Any |
Posted by: alpha6789 - Thursday, 19 July 2012 18:34:21 |
---|
Very interestingly, I tested on another machine, it shows the normal \r\n. Not sure if it's database problem or the operating system problem. |
Posted by: alpha6789 - Thursday, 19 July 2012 19:24:33 |
---|
Further investigation finds it's because the XmlSerializer doesn't deserialize the streamReader object correctly. it only parses new line as \n. Yucks. |