{348,92,363,354,369,347,346,232,214,116,189,350,188,62,356,354,162,21,175,110,173,290,356,350,251,250,164,176,284,244,334,171,342,113,377,329,154,243,94,355,297,110,249,348,327,172,92,348,348,119,369,188,290,175,130,171,125,332,54,125,125,345,353,0,50,228,50,228,378,125,189,354,172,35,253,170,208,133,253,131,294,333,345,124,189,164,370,131,241,171,345,50,181,110,33,84,190,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{190,84,228,250,250,197,84,345,157,190,37,83,250,190,196,196,388,0,82,120,130,101,310,315,117,152,114,37,111,348,57,330,319,196,243,369,345,186,345,356,305,345,345,345,373,373,384,24,348,186,369,345,70,175,82,193,355,50,250,371,321,378,375,0,188,5,17,320,14,371,189,373,386,97,68,82,355,32,90,241,355,305,308,286,81,326,81,64,320,376,250,283,284,284,313,330,131,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{122,330,345,316,294,332,162,220,329,329,148,335,110,339,327,367,216,202,386,368,92,386,92,92,37,35,35,110,344,349,335,10,363,335,386,37,345,367,311,171,171,40,251,335,349,212,133,220,46,357,354,40,348,208,367,388,250,357,345,354,75,328,348,0,54,388,63,40,130,344,110,349,183,227,328,227,345,183,173,95,143,55,171,55,249,249,17,44,110,136,335,356,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
};
//罗马数字
const char *charindex[94] =
{
"1","2","3","4","5","6","7","8","9","10","","","","","","",
"1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20",
"1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20",
"1","2","3","4","5","6","7","8","9","10","","",
"1","2","3","4","5","6","7","8","9","10","","",
"1","2","3","4","5","6","7","8","9","10","11","12","",""
};
//希腊数字
const char *charindex2[24] =
{
"a","b","g","d","e","z","e","th","i","k","l","m","n","x","o","p","r",
"s","t","u","ph","kh","ps","o"
};
/*
* 函数名称: makespellcode
* 参数: [in] strtext: cstring
* nmode: int
* [out] 得到的拼音: cstring
* nmode 二进制功能位说明
* x x x x x x x x x x x x x x x x
* 3 2 1
* 1: 0 - 只取各个汉字声母的第一个字母; 1 - 全取
* 2: 0 - 遇到不能翻译的字符不翻译; 1 - 翻译成 '?' (本选项目针对全角字符)
* 3: 0 - 生成的串不包括非数字, 字母的其他字符; 1 - 包括
* (控制全角的要输出非数字, 字母字符的; 半角的非数字, 字母字符)
*/
cstring cpy::makespellcode(cstring strtext, int nmode)
{
int i, index;
char apy[6] = {0};
bool fflag1, fflag2, fflag3;
unsigned char ctemp,ctemp1;
cstring pycode,strtemp;
fflag1 = ((nmode & 0x0001) == 1);
fflag2 = ((nmode & 0x0002) == 2);
fflag3 = ((nmode & 0x0004) == 4);
cstring result = "";
if(nmode < 0)
return result;
i = 0;
while (i < strtext.getlength() )
{
trace("%d\n",i);
ctemp = strtext.getat(i);
if( (i+1) != strtext.getlength())
ctemp1 = strtext.getat(i+1);
if( (ctemp >= 129) && (ctemp1 > 64 ) ) // 是否为 gbk 字符
{
switch(ctemp)
{
case 163: // 全角 ascii
apy[0] = ctemp1 - 128;
// 控制不能输出非数字, 字母的字符
if( (fflag3 != 1) && (apy[1]<48 && apy[1]>57) && (apy[1]<65 && apy[1]>90) && (apy[1]<97 && apy[1]>122))