Click here to Skip to main content
15,907,149 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I've written a POP3 class that access my email account and reads my messages but the body of the message is in unicode. How do I parse/convert this into a readable string?

Thanks in advance,
Donald
Posted

Don't read the bytes, read it as a string. .net Strings are in unicode.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 12-Jul-11 14:41pm    
Correct, but perhaps not clear to OP (too big confusion about encoding). My 5 for your answer.

I tried to explain a bit, more, please see my solution.
--SA
Unicode is always readable, you just need to use proper control to read Unicode. All the .NET and .NET controls do show Unicode and internally use its UTF-16 encoding.

See:
http://msdn.microsoft.com/en-us/library/system.text.encoding.aspx[^],
http://unicode.org/[^],
http://unicode.org/faq/utf_bom.html[^].

—SA
 
Share this answer
 
Comments
Mohammad A Rahman 15-Jul-11 23:49pm    
good answer :)
Sergey Alexandrovich Kryukov 19-Jul-11 0:00am    
Thank you, Mohammad.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900