I have the following body of message in quoted-printable:

=D0=9E=D1=82=D0=B2=D0=B5=D1=82 1 =D0=BD=D0=B0 test 05<br> ------------- <br=
><meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii=
"><meta name=3D"Generator" content=3D"Microsoft Word 14 (filtered medium)">=
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]--><div class=3D"WordSection1"><p class=3D"M=
soNormal"><span lang=3D"EN-US">Test 04<o:p></o:p></span></p></div>

The code above is decoded correctly by OpenPop. But when I set this string to HTMLBody it becomes incorrect(I see the following: Nrber 1 m` test 05 ------------- Test 04 )

rdoMessage.HTMLBody = decodedBody;

Also I have observed that it is shown correctly if I do the following:

rdoMessage.Body = decodedBody;
rdoMessage.HTMLBody = decodedBody;

What can cause this behaviour? How these two properties influence to each other?

有帮助吗?

解决方案

What version of Redemption are you using? You need to specify the code page in the HTML header. You also need to make sure it is correctly converted to the UTF-16 encoding (that is what COM uses). It is also a good idea to HTML-encode all non-ASCII characters in the HTML string.

其他提示

It is my understanding it happens on cross-platform and on smart tag copy/paste. There is encoding involved, e.g. UTF-8 or CP-1252.

Once in a while the decoding just screws up and gives you the unexpected [e.g. a command line].

Over here there is a discussion about the origins of this 'funny behavior': http://www.simplemachines.org/community/index.php?topic=475099.0

IMHO: There is no solution. Since smart tags are non-standard on the platform, nobody really cares and a real standard in the decoding between the codes itself is non-existent.

The users are [screwed] on their own.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top