RBrattas
RBrattas

Reputation: 11

two byte character or one byte character

How can I see if the input string is a two byte character or one byte character; and from which encoding system the character is coming from?

I am using C# and SilverLight; I assume I could find the encoding the computer is running and then the character? Any code snippet?

Thank you, Rune

// Get a UTF-32 encoding by codepage.Encoding Encoding_12000_instance = Encoding.GetEncoding(12000);

// Get a UTF-32 encoding by name.Encoding Encoding_UTF32_instance = Encoding.GetEncoding("utf-32");

Upvotes: 0

Views: 937

Answers (1)

Andrey
Andrey

Reputation: 60065

everything that is string in .net is in UTF-16. If you are getting input from other sources you need to get encoding name from it.

Upvotes: 2

Related Questions