开发者

Message charset

How do I g开发者_JAVA百科et the charset from javax.mail.Message object?


The mail API should convert the data to Unicode for you, so at the time when you can call the getter for the text, the original charset shouldn't matter.

But if you really need it, then call getContentType() and look for charset=. If it's there, then that's the encoding. If it isn't there, then the charset should be US-ASCII (7 bit).


The MimeMessage class has a method which returns the transfer encoding.

Edit: But, as Aaron correctly points out, you normally shouldn't have to worry.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜