. Net, C # kanji to pinyin, simplified traditional conversion method

Source: Internet
Author: User

The Visual Studio International Pack contains a set of class libraries that extend the. NET Framework's support for globalized software development. Using classes provided by this class library,. NET developers can more easily create software applications that support multi-cultural and multilingual languages: (1) (ChnCharInfo.dll) Simplified Chinese pin-yin Conversion library- Support to get Simplified Chinese characters commonly used properties such as pinyin, polyphone, phonetic characters, strokes number. "For example:"
1 Microsoft.International.Converters.PinYinConverter.ChineseChar cc=new Microsoft.International.Converters.PinYinConverter.ChineseChar (' state ');

(2) (ChineseConverter.dll) Traditional Chinese to Simplified Chinese Conversion Library and add-in tool-supports conversion between simplified and traditional Chinese. The component also contains a plugin (add-in) in a Visual Studio integrated development environment that supports conversion between simplified traditional Chinese resource files. "For example:"--simplified conversion to Traditional Chinese
1 String temp_1 = Microsoft.International.Converters.TraditionalChineseToSimplifiedConverter.ChineseConverter.Convert ("People's Republic of China", 2  3 Microsoft.International.Converters.TraditionalChineseToSimplifiedConverter.ChineseConversionDirection.SimplifiedToTraditi onal);

--conversion of traditional characters to simplified
1 String temp_2 = Microsoft.International.Converters.TraditionalChineseToSimplifiedConverter.ChineseConverter.Convert (Temp_1, 2  3 Microsoft.International.Converters.TraditionalChineseToSimplifiedConverter.ChineseConversionDirection.TraditionalToSimpli fied);

(3) (EastAsiaNumericFormatter.dll) East Asia Numeric Formatting Library-supports the formatting of lowercase numeric strings into uppercase numeric strings in Simplified Chinese, Traditional Chinese, Japanese, and Korean. "For example:"--Convert a number to uppercase Simplified Chinese (pick up the Hundred billion San Wu to pick up the land million seven Ba Bai Jiu pick point Wu)
1  

--Converts a number to lowercase (1,234,567,890,.45)
1 string temp_6 = string. Format (New Microsoft.International.Formatters.EastAsiaNumericFormatter (), "{0:ln}", 1234567890.45);

--Convert numbers to currencies (pick up the Hundred billion San Wu to pick up the land million seven Ba Bai Jiu pick point Wu)
1 string temp_7 = string. Format (New Microsoft.International.Formatters.EastAsiaNumericFormatter (), "{0:LC}", 1234567890.45);

Instance code:

12345678910111213141516171819202122 //简体/繁体切换            string temp_1 = ChineseConverter.Convert("中国人", ChineseConversionDirection.TraditionalToSimplified);            stringtemp_2 = ChineseConverter.Convert("中国人", ChineseConversionDirection.SimplifiedToTraditional);            Console.WriteLine("简体转换:"+temp_1+"\n繁体转换:"+temp_2);            //汉字转换拼音            stringr = string.Empty;            Console.Write("请输入任意汉字:");            stringstr = Console.ReadLine();            foreach(charobj instr)            {                try                {                    ChineseChar chineseChar = newChineseChar(obj);                    string t = chineseChar.Pinyins[0].ToString();                    r += t.Substring(0, t.Length - 1);                }                catch                {                    r += obj.ToString();                }            }            Console.WriteLine(r.ToLower().ToString());

Source:

  

Results:

. Net, C # kanji to pinyin, simplified traditional conversion method

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.