melektaus55 0 Newbie Poster
System.Text.Encoding enc =  System.Text.Encoding.Unicode;  
byte[] bytes = enc.GetBytes(plainTextContent);
string decodedText = Encoding.GetEncoding(charset).GetString(bytes);

"charset" is ISO-8859-1. If i use Unicode encoding, the GetString() method returns only the first character of bytes[], if i use ASCII or UTF-8 encoding i get all characters but there are some characters that are represented with "?"(so, GetString is unable to decode them). So i have two questions, how do i know which encoding to use, UTF-8, ASCII, Unicode or whatever...The message that i want to decode is the plain text body of an email message. The second question is...well, how to decode these "?" characters?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.