首页 > 编程知识 正文

北大青鸟主机汉字注释机内码表,北大青鸟11s汉字机内码表

时间:2023-05-05 05:28:39 阅读:176780 作者:3837

delphi取汉字的机内代码、UniCode代码

//机内代码-汉字

函数宏代码2字符(ai unicode : integer ) :字符串;

Var

ch、cl : Integer;

比根

ch :=AiUniCode Div 256;

cl :=AiUniCode Mod 256;

result:=chr(ch ) chr ) cl;

结束;

//汉字-机内代码

函数Chinese2maccode (ai Chinese : string ) :集成器;

Var

ch、cl : Integer;

比根

ch:=ord(AIChinese[1] );

cl:=ord(AIChinese[2] );

result:=(chSHL8) cl;

结束;

//UniCode -汉字

函数唯一代码2字符(ai unicode : integer ) :字符串;

Var

ch,cl : String[3];

s:斯特林;

比根

s:=inttohex(AIunicode,2 );

cl:='$'copy(s,1,2 );

ch:='$'copy(s,3,2 );

s:=chr(strtoint(ch ) ) chr (strtoint ) cl ) ) 0;

结果:=widechar tostring (pwidechar (s );

结束;

//汉字- UniCode

函数Chinese2unicode (ai Chinese : string ) :集成器;

Var

ch,cl : String[2];

a : array [1.2] of char;

比根

stringtowidechar (copy (ai Chinese,1,2 ),@ ) @(a[1],2 );

ch:=inttohex(integer(a[2],2 );

cl:=inttohex(integer(a[1],2 );

result:=strtoint('$'chcl;

结束;

//机内代码-汉字

函数宏代码2字符(ai unicode : integer ) :字符串;

Var

ch、cl : Integer;

比根

ch :=AiUniCode Div 256;

cl :=AiUniCode Mod 256;

result:=chr(ch ) chr ) cl;

结束;

//汉字-机内代码

函数Chinese2maccode (ai Chinese : string ) :集成器;

Var

ch、cl : Integer;

比根

ch:=ord(AIChinese[1] );

cl:=ord(AIChinese[2] );

result:=(chSHL8) cl;

结束;

//UniCode -汉字

函数唯一代码2字符(ai unicode : integer ) :字符串;

Var

ch,cl : String[3];

s:斯特林;

比根

s:=inttohex(AIunicode,2 );

cl:='$'copy(s,1,2 );

ch:='$'copy(s,3,2 );

s:=chr(strtoint(ch ) ) chr (strtoint ) cl ) ) 0;

结果:=widechar tostring (pwidechar (s );

结束;

//汉字- UniCode

函数Chinese2unicode (ai Chinese : string ) :集成器;

Var

ch,cl : String[2];

a : array [1.2] of char;

比根

stringtowidechar (copy (ai Chinese,1,2 ),@ ) @(a[1],2 );

ch:=inttohex(integer(a[2],2 );

cl:=inttohex(integer(a[1],2 );

result:=strtoint('$'chcl;

结束;

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。