Home > other >  Black screen interface code has a problem
Black screen interface code has a problem

Time:04-21

At present there is a demand will be through the passenger list, flight information automatically generated PNR
Through a variety of baidu data and their caught research, have been able to correct processing of the Chinese characters of GB2312 encoding table,
But once appear, the Chinese characters of GB2312 will make failure (input Chinese characters beyond word stock GB2312, please use Chinese pinyin input, INVALID CHARACTER, PLS NM1XXXX/XXXXXX), I am turned ascll code sent again, the result has a problem, please can give directions, how do the characters passed transcoding

Instructions below
NM: 1 杨喆 1 pick bin Chen


Transcoding code of Chinese characters are as follows:
 byte [] org=Encoding. GetEncoding (" GBK "). GetBytes (inputString); 
List Result=new List (a);
Bool flag=false;

Foreach (byte b in org)
{
if (! Flag & amp; & B & gt; 128)
{
Result. The AddRange (new byte [] x0e} {x1b 0, 0).
flag=true;
}
Else if (flag & amp; & B & lt;
=128){
Result. The AddRange (new byte [] {0 x1b, 0 x0f});
flag=false;
}
If (flag)
{
Result. The Add ((byte) (b - 128));
}
The else
{
Result. The Add (b);
}



  • Related