汉字转化为拼音

汉字|拼音

很多问题都是因为中文问题造成的
如文件名最好别用中文
现在的解决方法一般是产生一个ID,将这个ID做文件名
网页上如果url带汉字也经常出错
现在的解决方法一般用urlencode编码

现在用了这个转化,就好多了

原理,使用Dictionary技术
1.添加索引
2.遍历词典

<%
Set d = CreateObject("Scripting.Dictionary")
d.add "a",-20319
d.add "ai",-20317
d.add "an",-20304
d.add "ang",-20295
d.add "ao",-20292
d.add "ba",-20283
d.add "bai",-20265
d.add "ban",-20257
d.add "bang",-20242
d.add "bao",-20230
d.add "bei",-20051
d.add "ben",-20036
d.add "beng",-20032
d.add "bi",-20026
d.add "bian",-20002
d.add "biao",-19990
d.add "bie",-19986
d.add "bin",-19982
d.add "bing",-19976
d.add "bo",-19805
d.add "bu",-19784
d.add "ca",-19775
d.add "cai",-19774
d.add "can",-19763
d.add "cang",-19756
d.add "cao",-19751
d.add "ce",-19746
d.add "ceng",-19741
d.add "cha",-19739
d.add "chai",-19728
d.add "chan",-19725
d.add "chang",-19715
d.add "chao",-19540
d.add "che",-19531
d.add "chen",-19525
d.add "cheng",-19515
d.add "chi",-19500
d.add "chong",-19484
d.add "chou",-19479
d.add "chu",-19467
d.add "chuai",-19289
d.add "chuan",-19288
d.add "chuang",-19281
d.add "chui",-19275
d.add "chun",-19270
d.add "chuo",-19263
d.add "ci",-19261
d.add "cong",-19249
d.add "cou",-19243
d.add "cu",-19242
d.add "cuan",-19238
d.add "cui",-19235
d.add "cun",-19227
d.add "cuo",-19224
d.add "da",-19218
d.add "dai",-19212
d.add "dan",-19038
d.add "dang",-19023
d.add "dao",-19018
d.add "de",-19006
d.add "deng",-19003
d.add "di",-18996
d.add "dian",-18977
d.add "diao",-18961
d.add "die",-18952
d.add "ding",-18783
d.add "diu",-18774
d.add "dong",-18773
d.add "dou",-18763
d.add "du",-18756
d.add "duan",-18741
d.add "dui",-18735
d.add "dun",-18731
d.add "duo",-18722
d.add "e",-18710
d.add "en",-18697
d.add "er",-18696
d.add "fa",-18526
d.add "fan",-18518
d.add "fang",-18501
d.add "fei",-18490
d.add "fen",-18478
d.add "feng",-18463
d.add "fo",-18448
d.add "fou",-18447
d.add "fu",-18446
d.add "ga",-18239
d.add "gai",-18237
d.add "gan",-18231
d.add "gang",-18220
d.add "gao",-18211
d.add "ge",-18201
d.add "gei",-18184
d.add "gen",-18183
d.add "geng",-18181
d.add "gong",-18012
d.add "gou",-17997
d.add "gu",-17988
d.add "gua",-17970
d.add "guai",-17964
d.add "guan",-17961
d.add "guang",-17950
d.add "gui",-17947
d.add "gun",-17931
d.add "guo",-17928
d.add "ha",-17922
d.add "hai",-17759
d.add "han",-17752
d.add "hang",-17733
d.add "hao",-17730
d.add "he",-17721
d.add "hei",-17703
d.add "hen",-17701
d.add "heng",-17697
d.add "hong",-17692
d.add "hou",-17683
d.add "hu",-17676
d.add "hua",-17496
d.add "huai",-17487
d.add "huan",-17482
d.add "huang",-17468
d.add "hui",-17454
d.add "hun",-17433
d.add "huo",-17427
d.add "ji",-17417
d.add "jia",-17202
d.add "jian",-17185
d.add "jiang",-16983
d.add "jiao

时间: 2024-10-08 07:35:21

汉字转化为拼音的相关文章

能把汉字转化为拼音的一个函数

函数|汉字|拼音 能把汉字转化为拼音的一个函数-------------------------------------------------------------------------------- 作者:qiushuiwuhen 来源:CSDN 很多问题都是因为中文问题造成的 如文件名最好别用中文 现在的解决方法一般是产生一个ID,将这个ID做文件名 网页上如果url带汉字也经常出错 现在的解决方法一般用urlencode编码 现在用了这个转化,就好多了 原理:利用多维数组 1.添加索

汉字转化为拼音(php版)_php基础

汉字转化为拼音(php版) 很多服务器对于中文文件名支持不是很好,有没有好的办法来解决呢???现在的解决方法一般是产生一个ID,将这个ID做文件名:网页上如果url带汉字也经常出错:现在的解决方法一般用urlencode编码 现在用了这个转化,就好多了 原理:利用多维数组 1.添加索引 2.遍历数组 <? $d=array( array("a",-20319), array("ai",-20317), array("an",-20304),

基于PHP如何把汉字转化为拼音_php实例

PHP将汉字转换拼音是程序员们经常需要操作的任务之一,别看这一小功能却能发挥很大的作用,以下是正确的汉字转拼音方法,大家可以借鉴一下. 具体代码如下所示: <pre class="brush:php"><?php $d=array( array("a",-20319), array("ai",-20317), array("an",-20304), array("ang",-20295),

asp.net(C#)把汉字转化成全拼音函数(全拼)_实用技巧

复制代码 代码如下: /// <summary> /// 把汉字转换成拼音(全拼) /// </summary> /// <param name="hzString">汉字字符串</param> /// <returns>转换后的拼音(全拼)字符串</returns> public static string ConvertE(string hzString) { // 匹配中文字符 Regex regex = n

汉字转化为拼音(php版)

汉字|拼音 很多服务器对于中文文件名支持不是很好,有没有好的办法来解决呢???现在的解决方法一般是产生一个ID,将这个ID做文件名:网页上如果url带汉字也经常出错:现在的解决方法一般用urlencode编码 现在用了这个转化,就好多了 原理:利用多维数组 1.添加索引 2.遍历数组 <? $d=array( array("a",-20319), array("ai",-20317), array("an",-20304), array(&

ASP将汉字转化为拼音

汉字|拼音 很多问题都是因为中文问题造成的 如文件名最好别用中文 现在的解决方法一般是产生一个ID,将这个ID做文件名 网页上如果url带汉字也经常出错 现在的解决方法一般用urlencode编码 现在用了这个转化,就好多了原理,使用Dictionary技术1.添加索引2.遍历词典<%Set d = CreateObject("Scripting.Dictionary")d.add "a",-20319d.add "ai",-20317d.

汉字转化为拼音(asp版)

汉字|拼音 很多问题都是因为中文问题造成的 如文件名最好别用中文 现在的解决方法一般是产生一个ID,将这个ID做文件名 网页上如果url带汉字也经常出错 现在的解决方法一般用urlencode编码 现在用了这个转化,就好多了 原理,使用Dictionary技术1.添加索引2.遍历词典 <%Set d = CreateObject("Scripting.Dictionary")d.add "a",-20319d.add "ai",-20317

ASP例子:ASP把汉字转化为拼音的函数

函数|汉字|拼音 拼音不够全面,不推荐使用,学习一下方法而已- <%     Set d = CreateObject("Scripting.Dictionary")     d.add "a",-20319     d.add "ai",-20317     d.add "an",-20304     d.add "ang",-20295     d.add "ao",-2029

GBK汉字转化为拼音或笔画的PHP类

汉字|拼音 拼音源代码<?/***********************************************************************                       Written by caocao                       caocao@eastday.com                       http://nethermit.yeah.net************************************