汉字转拼音
Public Function getPYChar(char As String) As String
Dim lChar As Long
lChar = 65536 + Asc(char)
If (lChar >= 45217 And lChar <= 45252) Then getPYChar = "A"
If (lChar >= 45253 And lChar <= 45760) Then getPYChar = "B"
If (lChar >= 47761 And lChar <= 46317) Then getPYChar = "C"
If (lChar >= 46318 And lChar <= 46825) Then getPYChar = "D"
If (lChar >= 46826 And lChar <= 47009) Then getPYChar = "E"
If (lChar >= 47010 And lChar <= 47296) Then getPYChar = "F"
If (lChar >= 47297 And lChar <= 47613) Then getPYChar = "G"
If (lChar >= 47614 And lChar <= 48118) Then getPYChar = "H"
If (lChar >= 48119 And lChar <= 49061) Then getPYChar = "J"
If (lChar >= 49062 And lChar <= 49323) Then getPYChar = "K"
If (lChar >= 49324 And lChar <= 49895) Then getPYChar = "L"
If (lChar >= 49896 And lChar <= 50370) Then getPYChar = "M"
If (lChar >= 50371 And lChar <= 50613) Then getPYChar = "N"
If (lChar >= 50614 And lChar <= 50621) Then getPYChar = "O"
If (lChar >= 50622 And lChar <= 50905) Then getPYChar = "P"
If (lChar >= 50906 And lChar <= 51386) Then getPYChar = "Q"
If (lChar >= 51387 And lChar <= 51445) Then getPYChar = "R"
If (lChar >= 51446 And lChar <= 52217) Then getPYChar = "S"
If (lChar >= 52218 And lChar <= 52697) Then getPYChar = "T"
If (lChar >= 52698 And lChar <= 52979) Then getPYChar = "W"
If (lChar >= 52980 And lChar <= 53640) Then getPYChar = "X"
If (lChar >= 53689 And lChar <= 54480) Then getPYChar = "Y"
If (lChar >= 54481 And lChar <= 52289) Then getPYChar = "Z"
End Function
Public Function getPY(str As String) As String
For i = 0 To Len(str) - 1
getPY = getPY & getPYChar(Mid(str, i + 1, 1))
Next
End Function
相关阅读
传送门:https://my.oschina.net/tommyfok/blog/202412 代码:/* --- description: Pinyin, to get chinese pinyin from chinese. l
使用各种嵌入式GUI时,总会遇到“汉字显示”“字体”这些关卡。 阅读本文前,最好已经了解Uincode,UTF-8,UTF-16,GBK,GB2312相关知识,
安装五笔和拼音 安装ibus框架 sudo apt-get install ibus ibus-clutter ibus-gtk ibus-gtk3 ibus-qt4 启用Ibus框架 im-con
今天偶然发现谷歌拼音输入法PC版的网页消失了,我想以后可能都不会有了,除非谷歌重返大陆。 PC端的谷歌拼音输入法从2013年就已经停
明明切换的是中文输入法,怎么在Word里面就输入不出来汉字呢?各个版本都试过了,还是这样,难道是Office出了问题,亦或者安装的输入法的问