重音字符没有显示出来 [英] Accented characters not showing up
问题描述
我有一个在那里发送电子邮件到用户的要求,他可以直接回复电子邮件,该电子邮件的内容被张贴在他的帐户。
I have a requirement where an email is sent to an user and he can directly reply to the email and that email's content gets posted in his account.
问题是重音符号没有显示正确,当用户帖子来自他的电子邮件的内容。我用发送电子邮件 MailMessage
类:
Problem is accented characters are not showing up properly when user posts the content from his email. I send email using MailMessage
class:
message.BodyEncoding = Encoding.UTF8;
message.SubjectEncoding = Encoding.UTF8;
正如你所看到的身体和主题是UTF8连接$ C $ CD。但是,当我发布消息,从我的电子邮件,口音被转换为?。谁能告诉我,我缺少什么?
As you can see both the body and subject are UTF8 encoded. But when I post the message from my email, the accent gets converted to ?. Can anybody tell me what am I missing?
编辑:这是否有什么关系 IsBodyHtml
?我没有设置 IsBodyHtml
为true。是必需的?
Does this have anything to do with IsBodyHtml
? I haven't set IsBodyHtml
to true. Is that required?
推荐答案
我看来,尽管使用了UTF8编码用于人体的默认介质类型为text / plain的 - 这是ASCII码(即的 ASCII 字符集)。如果你使用 IsBodyHtml
,它将使用text / html的媒体类型,将使用的 ISO-8859-1 的字符集。
I appears that despite using UTF8 for the encoding the default media type used for the body is text/plain--which is ASCII (i.e. the ASCII character set). If you use IsBodyHtml
, it will use a media type of text/html which will use the ISO-8859-1 character set.
这篇关于重音字符没有显示出来的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!