首先有必要说下机内码与区位:
机内码高位字节=(区号)H+A0H
机内码低位字节=(位号)H+A0H
例子:
string str = "陈"; // 机内码存储,占两个字节
unsigned char ucHigh = (unsigned char)strText[0]; // 获取机内码高字节 ucHigh = 179
unsigned char ucLow = (unsigned char)strText[1]; // 获取机内码低字节 ucLow = 194
unsigned int uCode = (ucHigh - 0xA0) * 100 + ucLow - 0xA0; // 区位码 uCode = (179 - 160) * 100 + 194 - 160 = 1934;
接下来就是根据区位码 1934 找到对应的拼音,怎么找呢?看源码吧。
源码下载
http://pan.baidu.com/share/link?shareid=483963&uk=1812123514