How can i see my characters

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I get a byte array (byte[]) as a e-mail from pop3 server. I want to see the
Turkish characters like (ş,Ş,ü,Ü, etc.).

When i use
System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding();
string str = enc.GetString(msg);

i can not see special Turkish characters. So i prefer to use
System.Text.UnicodeEncoding enc0 = new System.Text.UnicodeEncoding();
string str0 = enc0.GetString(msg);

but then i only see an array of smal "squares". Then i tried to use,
System.Text.UTF32Encoding enc2 = new System.Text.UTF32Encoding();
string str2 = enc2.GetString(msg);

and then i get an emtpy string "str2". I am not sure whether these special
Turkish characters are defined in UTF-32 or not.

How can i get special Turkish charecters?
Thanks a lot.....
 
The encoding of the mail body is specified in the mail, either in the
mail header or the multipart section for the body.

If it uses Unicode, it's most likely UTF8.
 
If i change this part of a mail properly, then i see these characters
correctly?

Göran Andersson said:
The encoding of the mail body is specified in the mail, either in the
mail header or the multipart section for the body.

If it uses Unicode, it's most likely UTF8.
I get a byte array (byte[]) as a e-mail from pop3 server. I want to see the
Turkish characters like (ş,Ş,ü,Ü, etc.).

When i use
System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding();
string str = enc.GetString(msg);

i can not see special Turkish characters. So i prefer to use
System.Text.UnicodeEncoding enc0 = new System.Text.UnicodeEncoding();
string str0 = enc0.GetString(msg);

but then i only see an array of smal "squares". Then i tried to use,
System.Text.UTF32Encoding enc2 = new System.Text.UTF32Encoding();
string str2 = enc2.GetString(msg);

and then i get an emtpy string "str2". I am not sure whether these special
Turkish characters are defined in UTF-32 or not.

How can i get special Turkish charecters?
Thanks a lot.....
 
No, the other way around. You use the information in the mail to
determine what Encoding you should use to decode the content of the mail.
If i change this part of a mail properly, then i see these characters
correctly?

Göran Andersson said:
The encoding of the mail body is specified in the mail, either in the
mail header or the multipart section for the body.

If it uses Unicode, it's most likely UTF8.
I get a byte array (byte[]) as a e-mail from pop3 server. I want to see the
Turkish characters like (ş,Ş,ü,Ü, etc.).

When i use
System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding();
string str = enc.GetString(msg);

i can not see special Turkish characters. So i prefer to use
System.Text.UnicodeEncoding enc0 = new System.Text.UnicodeEncoding();
string str0 = enc0.GetString(msg);

but then i only see an array of smal "squares". Then i tried to use,
System.Text.UTF32Encoding enc2 = new System.Text.UTF32Encoding();
string str2 = enc2.GetString(msg);

and then i get an emtpy string "str2". I am not sure whether these special
Turkish characters are defined in UTF-32 or not.

How can i get special Turkish charecters?
Thanks a lot.....
 
Back
Top