开发者

two byte character or one byte character

开发者 https://www.devze.com 2022-12-25 17:52 出处:网络
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?

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号