Visual Studio International Pack 包含一组类库,该类库扩展了.NET Framework对全球化软件开发的支持。使用该类库提供的类,.NET 开发人员可以更方便的创建支持多文化多语言的软件应用
下载地址:下载地址
 
(1) (ChnCharInfo.dll)
Simplified Chinese Pin-Yin Conversion Library
- 支持获取简体中文字符的常用属性比如拼音,多音字,同音字,笔画数。
 
【例如:】
1 Microsoft.International.Converters.PinYinConverter.ChineseChar cc=new Microsoft.International.Converters.PinYinConverter.ChineseChar('国');
 
 
(2)(ChineseConverter.dll)
Traditional Chinese to Simplified Chinese Conversion Library and Add-In Tool
- 支持简繁体中文之间的转换。该组件还包含一个Visual Studio集成开发环境中的插件(Add-in)支持简繁体中文资源文件之间的转换。
 
【例如:】
--简体转换为繁体字
1 string temp_1 = Microsoft.International.Converters.TraditionalChineseToSimplifiedConverter.ChineseConverter.Convert("中华人民共和国",
2
3 Microsoft.International.Converters.TraditionalChineseToSimplifiedConverter.ChineseConversionDirection.SimplifiedToTraditional);
 
--繁体字转换为简体
1 string temp_2 = Microsoft.International.Converters.TraditionalChineseToSimplifiedConverter.ChineseConverter.Convert(temp_1,
2
3 Microsoft.International.Converters.TraditionalChineseToSimplifiedConverter.ChineseConversionDirection.TraditionalToSimplified);
 
 
(3)(EastAsiaNumericFormatter.dll)
East Asia Numeric Formatting Library - 支持将小写的数字字符串格式化成简体中文,繁体中文,日文和韩文的大写数字字符串。
【例如:】
--将数字转换为大写简体中文(拾贰亿叁仟肆佰伍拾陆万柒仟捌佰玖拾点肆伍)
 
1  1 string temp_4 = string.Format(new Microsoft.International.Formatters.EastAsiaNumericFormatter(), "{0:L}", 1234567890.45); 
 
--将数字转换为小写(十二亿三千四百五十六万七千八百九十点四五)
 
1 string temp_6 = string.Format(new Microsoft.International.Formatters.EastAsiaNumericFormatter(), "{0:Ln}", 1234567890.45);
 
--将数字转换为货币(拾贰亿叁仟肆佰伍拾陆万柒仟捌佰玖拾点肆伍)
 
1 string temp_7 = string.Format(new Microsoft.International.Formatters.EastAsiaNumericFormatter(), "{0:Lc}", 1234567890.45);

实例代码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
//简体/繁体切换
            string temp_1 = ChineseConverter.Convert("中国人", ChineseConversionDirection.TraditionalToSimplified);
            string temp_2 = ChineseConverter.Convert("中国人", ChineseConversionDirection.SimplifiedToTraditional);
            Console.WriteLine("简体转换:"+temp_1+"\n繁体转换:"+temp_2);
            //汉字转换拼音
            string r = string.Empty;
            Console.Write("请输入任意汉字:");
            string str = Console.ReadLine();
            foreach (char obj in str)
            {
                try
                {
                    ChineseChar chineseChar = new ChineseChar(obj);
                    string t = chineseChar.Pinyins[0].ToString();
                    r += t.Substring(0, t.Length - 1);
                }
                catch
                {
                    r += obj.ToString();
                }
            }
            Console.WriteLine(r.ToLower().ToString());

源码:

  

结果:

.Net、C# 汉字转拼音,简体繁体转换方法的更多相关文章

  1. c#简体繁体转换

     方法一已经亲测,使用正常,方法二貌似不能用. 方法一 /// <summary> /// 中文字符工具类 /// </summary> public static class ...

  2. 汉字简体繁体转换----Javascript

    最近看到有个简体--繁体字互相转换的程序,是用JS实现的,感觉很好玩,所以拿来研究研究.先看看界面如下: 汉字简体繁体转换 // 0&&parent.frames.length) { ...

  3. 【推荐】iOS汉字转拼音第三方库

    PinYin4Objc是一个在git汉字转拼音的开源库,支持简体和繁体中文.效率POAPinyin等其他库要高,转换库也完整下面简单介绍 实现原理 使用unicode_to_hanyu_pinyin. ...

  4. 最好用的汉字转拼音代码PinYin4Objc(PinYin4J的objc版本)

    转:https://github.com/kimziv/PinYin4Objc 最好用的汉字转拼音代码PinYin4Objc(PinYin4J的objc版本)(更新到v1.1.1,增加block异步处 ...

  5. .NET Core使用微软官方类库实现汉字转拼音

    一.NuGet包 拼音:Install-Package SimplifiedChinesePinYinConversion 简体-繁体互转:Install-Package TraditionalChi ...

  6. PHP 中文工具类,支持汉字转拼音、拼音分词、简繁互转

    ChineseUtil 下载地址:https://github.com/Yurunsoft/ChineseUtil 另外一个中文转拼音工具:https://github.com/overtrue/pi ...

  7. JAVA实现汉字转换为拼音 pinyin4j/JPinyin

    在项目中经常会遇到需求用户输入汉字后转换为拼音的场景,比如说通讯录,就会要求按名字首字符发音排序,如果自己写实现这方面的功能是个很好大的工程,还好网上有公开的第三方jar支持转换,结合网上很多前辈的代 ...

  8. C#中实现输入汉字获取其拼音(汉字转拼音)的2种方法

    主要介绍了C#中实现输入汉字获取其拼音(汉字转拼音)的2种方法,本文分别给出了使用微软语言包.手动编码实现两种实现方式,需要的朋友可以参考下 本文刚发布时,只写了一个实现方式,使用的是微软的语言包,但 ...

  9. iOS 汉字转拼音 PinYin4Objc

    PinYin4Objc 是一个效率很高的汉字转拼音类库,支持简体和繁体中文.有以下特性:1.效率高,使用数据缓存,第一次初始化以后,拼音数据存入文件缓存和内存缓存,后面转换效率大大提高:2.支持自定义 ...

随机推荐

  1. shell脚本查看服务器基本信息

    #!/bin/sh #电脑概览 #电脑型号 ComputerModel=`/usr/bin/sudo /usr/sbin/dmidecode | grep -A2 "System Infor ...

  2. 武汉天喻的NFS 磁盘问题

    public void AsyncPaper() { while (true) { try { var jsonText = RedisHelper.BlockPopItemFromList(&quo ...

  3. json model 互转

    1.json转model TestModel tm = new TestModel();JavaScriptSerializer js = new JavaScriptSerializer();tm ...

  4. codeforces-723D

    题目连接:http://codeforces.com/contest/723/problem/D D. Lakes in Berland time limit per test 2 seconds m ...

  5. 【bzoj3687】【简单题】bitset

    [pixiv] https://www.pixiv.net/member_illust.php?mode=medium&illust_id=64333782 这次的图是自己画的,方便的话点个赞 ...

  6. linux下内存释放问题

    参考: http://blog.sina.com.cn/s/blog_3cba7ec10100gk4k.html http://blog.sina.com.cn/s/blog_3cba7ec10100 ...

  7. xcode 6 exporting ipa 提示 Your account already has a valid iOS distribution certificate 的另一种解决方法

    背景: 1. XCode 6.1 2. 证书:develop 证书 3. Scheme 为Device 操作: 在Product - Archive 包过程中,选择Save for Ad hoc De ...

  8. DOTween教程

    参考自DOTween官方文档: DOTween起始上手起来很快,当然前提也是用心看一下哈. > 可以在Unity AssetStore下载得到. 使用方法: 准备: 在导入DOTween后,你需 ...

  9. 利用【深度网络】高效提取feature

    extracting features from a learned model, and add some new features yourself.

  10. 栅格 CSS中的循环 媒体查询

    第三天Bootstrap 模态框 1.要使用模态框,需要现在body里,添加展示模态框的html代码.此时模态框是看不见的 2.如果要显示,$(“.modal”).modal(“show”); 3.如 ...