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 code开发者_运维百科page.Encoding Encoding_12000_instance = Encoding.GetEncoding(12000);
// Get a UTF-32 encoding by name.Encoding Encoding_UTF32_instance = Encoding.GetEncoding("utf-32");
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.
精彩评论