How can i see my characters

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.....
 
G

Guest

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.
 
G

Guest

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.....
 
G

Guest

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.....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top