C#对汉语拼音,繁体简体转换的支持
添加引用:
ChineseConverter.dll(对 繁体简体转换的支持 ) ,ChnCharInfo.dll (对拼音的支持)。微软发布的补丁!
测试代码如下:
ChineseChar cc=new ChineseChar('捷'); ReadOnlyCollection pinyin = cc.Pinyins; foreach (string item in pinyin) { if (!string.IsNullOrEmpty(item)) { Console.WriteLine(item + ";"); } } string strTest="中华人民共和国"; string strTradition= ChineseConverter.Convert(strTest, ChineseConversionDirection.SimplifiedToTraditional); Console.WriteLine(strTest + "的繁体是:" + strTradition); Console.WriteLine(strTradition + "的简体是:" +ChineseConverter.Convert (strTradition,ChineseConversionDirection.TraditionalToSimplified));