Code for converting a Chinese character into a pinyin character

Source: Internet
Author: User

1. Add an index
2. traverse the dictionary
<%
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 "plugin",-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",-16970.
D. Add "jie",-16942
D. Add "Jin",-16915.
D. Add "jing",-16733.
D. Add "jiong",-16708.
D. Add "Jiu",-16706.
D. Add "Ju",-16689.
D. Add "Juan",-16664.
D. Add "Jue",-16657.
D. Add "Jun",-16647.
D. Add "ka",-16474
D. Add "Kai",-16470
D. Add "kan",-16465
D. Add "Kang",-16459.
D. Add "kao",-16452.
D. Add "Ke",-16448.
D. Add "Ken",-16433
D. Add "Keng",-16429.
D. Add "Kong",-16427.
D. Add "Kou",-16423.
D. Add "ku",-16419.
D. Add "Kua",-16412.
D. Add "Kuai",-16407
D. Add "Kuan",-16403
D. Add "Kuang",-16401.
D. Add "Kui",-16393.
D. Add "Kun",-16220.
D. Add "Kuo",-16216.
D. Add "La",-16212
D. Add "Lai",-16205.
D. Add "Lan",-16202
D. Add "Lang",-16187.
D. Add "Lao",-16180.
D. Add "Le",-16171.
D. Add "lei",-16169.
D. Add "leng",-16158.
D. Add "Li",-16155.
D. Add "Lia",-15959
D. Add "Lian",-15958.
D. Add "Liang",-15944.
D. Add "liao",-15933.
D. Add "lie",-15920.
D. Add "Lin",-15915
D. Add "Ling",-15903
D. Add "Liu",-15889.
D. Add "long",-15878.
D. Add "Lou",-15707
D. Add "Lu",-15701.
D. Add "LV",-15681.
D. Add "Luan",-15667.
D. Add "Lue",-15661.
D. Add "Lun",-15659
D. Add "Luo",-15652.
D. Add "Ma",-15640.
D. Add "Mai",-15631.
D. Add "man",-15625
D. Add "mang",-15454.
D. Add "Mao",-15448.
D. Add "me",-15436.
D. Add "Mei",-15435.
D. Add "men",-15419
D. Add "Meng",-15416.
D. Add "mi",-15408.
D. Add "Mian",-15394.
D. Add "Miao",-15385.
D. Add "mini",-15377
D. Add "min",-15375.
D. Add "Ming",-15369.
D. Add "Miu",-15363.
D. Add "Mo",-15362.
D. Add "MOU",-15183.
D. Add "Mu",-15180.
D. Add "Na",-15165.
D. Add "Nai",-15158.
D. Add "Nan",-15153.
D. Add "Nang",-15150.
D. Add "Nao",-15149.
D. Add "ne",-15144
D. Add "Nei",-15143.
D. Add "Nen",-15141.
D. Add "neng",-15140
D. Add "Ni",-15139.
D. Add "Nian",-15128
D. Add "Niang",-15121.
D. Add "niao",-15119.
D. Add "Nie",-15117
D. Add "Nin",-15110.
D. Add "Ning",-15109
D. Add "niu",-14941.
D. Add "Nong",-14937.
D. Add "Nuu",-14933
D. Add "NV",-14930.
D. Add "Nuan",-14929
D. Add "nue",-14928.
D. Add "nuo",-14926.
D. Add "O",-14922.
D. Add "ou",-14921
D. Add "Pa",-14914.
D. Add "Pai",-14908
D. Add "pan",-14902
D. Add "Pang",-14894.
D. Add "pao",-14889.
D. Add "Pei",-14882.
D. Add "pen",-14873.
D. Add "peng",-14871.
D. Add "Pi",-14857.
D. Add "pian",-14678
D. Add "Piao",-14674.
D. Add "pie",-14670
D. Add "pin",-14668.
D. Add "ping",-14663.
D. Add "po",-14654.
D. Add "Pu",-14645.
D. Add "Qi",-14630.
D. Add "QIA",-14594.
D. Add "Qian",-14429.
D. Add "Qiang",-14407.
D. Add "Qiao",-14399.
D. Add "Qie",-14384.
D. Add "Qin",-14379.
D. Add "Qing",-14368.
D. Add "Qiong",-14355.
D. Add "Qiu",-14353.
D. Add "Qu",-14345.
D. Add "Quan",-14170.
D. Add "que",-14159.
D. Add "Qun",-14151.
D. Add "ran",-14149
D. Add "rang",-14145.
D. Add "raid",-14140
D. Add "re",-14137.
D. Add "Ren",-14135
D. Add "reng",-14125.
D. Add "Ri",-14123
D. Add "rong",-14122.
D. Add "Rou",-14112.
D. Add "Ru",-14109.
D. Add "Ruan",-14099.
D. Add "Rui",-14097.
D. Add "run",-14094
D. Add "RuO",-14092.
D. Add "sa",-14090.
D. Add "sai",-14087
D. Add "San",-14083
D. Add "sang",-13917.
D. Add "Sao",-13914.
D. Add "se",-13910.
D. Add "Sen",-13907
D. Add "Seng",-13906.
D. Add "Sha",-13905.
D. Add "Shai",-13896
D. Add "Shan",-13894
D. Add "Shang",-13878.
D. Add "shao",-13870.
D. Add "she",-13859
D. Add "shen",-13847.
D. Add "Sheng",-13831.
D. Add "Shi",-13658
D. Add "Shou",-13611.
D. Add "Shu",-13601.
D. Add "Shua",-13406.
D. Add "Shuai",-13404.
D. Add "Shuan",-13400.
D. Add "Shuang",-13398.
D. Add "Shui",-13395.
D. Add "Shun",-13391
D. Add "Shuo",-13387.
D. Add "Si",-13383.
D. Add "song",-13367.
D. Add "Sou",-13359.
D. Add "Su",-13356.
D. Add "Suan",-13343.
D. Add "Sui",-13340.
D. Add "sun",-13329
D. Add "Suo",-13326.
D. Add "ta",-13318.
D. Add "Tai",-13147.
D. Add "Tan",-13138.
D. Add "Tang",-13120.
D. Add "Tao",-13107.
D. Add "te",-13096.
D. Add "Teng",-13095.
D. Add "ti",-13091.
D. Add "Tian",-13076.
D. Add "tiao",-13068.
D. Add "Tie",-13063
D. Add "ting",-13060
D. Add "tong",-12888.
D. Add "TOU",-12875.
D. Add "tu",-12871
D. Add "tuan",-12860
D. Add "Tui",-12858.
D. Add "tun",-12852.
D. Add "Tuo",-12849.
D. Add "wa",-12838
D. Add "Wai",-12831.
D. Add "Wan",-12829
D. Add "Wang",-12812.
D. Add "wei",-12802.
D. Add "Wen",-12607
D. Add "Weng",-12597.
D. Add "wo",-12594
D. Add "Wu",-12585.
D. Add "Xi",-12556.
D. Add "xia",-12359.
D. Add "Xian",-12346.
D. Add "Xiang",-12320.
D. Add "Xiao",-12300.
D. Add "xie",-12120
D. Add "Xin",-12099.
D. Add "Xing",-12089.
D. Add "Xiong",-12074.
D. Add "Xiu",-12067.
D. Add "Xu",-12058.
D. Add "Xuan",-12039.
D. Add "Xue",-11867.
D. Add "Xun",-11861.
D. Add "ya",-11847
D. Add "Yan",-11831
D. Add "yang",-11798.
D. Add "Yao",-11781.
D. Add "ye",-11604.
D. Add "Yi",-11589.
D. Add "Yin",-11536.
D. Add "ying",-11358.
D. Add "yo",-11340
D. Add "Yong",-11339.
D. Add "you",-11324
D. Add "yu",-11303.
D. Add "Yuan",-11097.
D. Add "Yue",-11077.
D. Add "Yun",-11067.
D. Add "za",-11055
D. Add "Zai",-11052
D. Add "Zan",-11045.
D. Add "Zang",-11041.
D. Add "Zao",-11038.
D. Add "ze",-11024.
D. Add "Zei",-11020.
D. Add "Zen",-11019
D. Add "Zeng",-11018.
D. Add "zha",-11014
D. Add "Zhai",-10838.
D. Add "Zhan",-10832.
D. Add "Zhang",-10815
D. Add "Zhao",-10800.
D. Add "zhe",-10790.
D. Add "Zhen",-10780.
D. Add "zheng",-10764.
D. Add "Zhi",-10587.
D. Add "Zhong",-10544.
D. Add "Zhou",-10533.
D. Add "zhu",-10519.
D. Add "zhua",-10331.
D. Add "zhuai",-10329.
D. Add "Zhuan",-10328.
D. Add "zhuang",-10322
D. Add "Zhui",-10315.
D. Add "Zhun",-10309.
D. Add "Zhuo",-10307.
D. Add "zi",-10296.
D. Add "Zong",-10281.
D. Add "zou",-10274.
D. Add "Zu",-10270.
D. Add "Zuan",-10262
D. Add "Zui",-10260.
D. Add "Zun",-10256.
D. Add "Zuo",-10254.

function g (Num)
If num> 0 and num <160 then
G = CHR (Num)
else
If num <-20319 or num>-10247 then
G = ""
else
A = D. items
B = D. keys
for I = D. count-1 to 0 step-1
If a (I) <= num then exit for
next
G = B (I)
end if
end function
Function C (STR)
C = ""
for I = 1 to Len (STR)
C = C & G (ASC (mid (STR, I, 1 )))
next
end function
response. write c (Request ("HZ")
%>


enter Chinese characters here:

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.