We know that Silverlight does not support gb2312 encoding. Therefore, Silverlight for Windows Phone naturally does not support gb2312 encoding, and thus cannot use the "C # Chinese character to PinYin" method on the Internet. In fact, we can use a stupid method to put Chinese characters and Pinyin in an array and traverse the array for matching.
Create a Chinese auxiliary class chinesehelper. There are two static methods to obtain the pinyin corresponding to the Chinese character and determine whether the character is a Chinese character
Below is the testCodeAnd running effect
Source codeDownload:
Original path: http://www.cnblogs.com/alexis/archive/2011/06/11/2070513.html
We know that Silverlight does not support gb2312 encoding. Therefore, Silverlight for Windows Phone naturally does not support gb2312 encoding, and thus cannot use the "C # Chinese character to PinYin" method on the Internet. In fact, we can use a stupid method to put Chinese characters and Pinyin in an array and traverse the array for matching.
Create a Chinese auxiliary class chinesehelper. There are two static methods to obtain the pinyin corresponding to the Chinese character and determine whether the character is a Chinese character
Below is the test code and Running Effect
Source code download: