首页 > 其他分享 >用delphi生成GBK 中文编码 表(4~5) GBK/4~5: 0xAA40~0xFEA0(部分) 扩充汉字 包括繁体 0xA

用delphi生成GBK 中文编码 表(4~5) GBK/4~5: 0xAA40~0xFEA0(部分) 扩充汉字 包括繁体 0xA

时间:2024-03-01 09:03:46浏览次数:19  
标签:10 13 0xAA40 32 delphi GBK 汉字 ss

 

http://www.cnblogs.com/jfyes/archive/2009/09/24/1573638.html

  GBK 中文编码: (* GBK是GB2312的扩展,是向上兼容的,因此GB2312中的汉字的编码与GBK中汉字的相同。 
GBK中每个汉字仍然包含两个字节, 第一个字节的范围是0x81-0xFE(即129-254),第二个字节的范围是0x40-0xFE
(即64-254)。GBK中有码位23940个, 包含汉字21003个。
--------------------------------------
GBK/1: 0xA1A0~0xA9EF(部分) GB2312非汉字符号
GBK/2: 0xB0A0~0xF7FE(部分) GB2312汉字
上面两个是GB2312的扩展,是向上兼容的;
--------------------------------------------------------------
GBK/3: 0x8140~0xA0FE(部分) 扩充汉字 包括繁体 ----> 
GBK/4: 0xAA40~0xFEA0(部分) 扩充汉字 包括繁体
GBK/5: 0xA840~0xA995(部分) 扩充非汉字

 

  1 procedure Tfm_Words.Button5Click(Sender: TObject);
  2 var
  3   A, B: Cardinal;
  4   I, J: Integer;
  5   sHex: string;
  6   s1: WideString;
  7   ss: string;
  8 begin
  9 //GBK/5: 0xA840~0xA995(部分) 扩充非汉字
 10   ss := #13#10+
 11         '                GBK/5: $A840~$A996(部分) 扩充非汉字                '#13#10+
 12         '                                           jfyes 2008-07-07'#13#10#13#10;
 13 
 14   for  I:=  $A8 to $A9 do
 15   begin
 16 
 17      for J := $40 to $96 do
 18      begin
 19 
 20        sHex := Format('$%.2x%.2x', [I, J]);
 21        A := SysUtils.StrToIntDef(sHex, 0);
 22        
 23        if J = $40 then
 24          ss := ss+ 'code  +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F ';
 25 
 26 
 27        if J in [$40, $50,$60, $70, $80,$90, $A0, $B0, $C0, $D0, $E0, $F0] then
 28          ss := ss + #13#10 + sHex+ #32;
 29 
 30        if J <> $7F then
 31          ss := ss + Char(I) + Char(J) + #32
 32        else ss := ss + #32#32#32
 33 
 34 
 35      end;
 36      ss := ss + #13#10#13#10;
 37   end;
 38 self.memo1.lines.add(ss, True);
 39 end;  
 40 
 41 执行结果如下:
 42 ------------------------------------------------------------------------------
 43                 GBK/5: $A840~$A996(部分) 扩充非汉字                
 44                               
 45 code  +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F 
 46 $A840 ˊ ˋ ˙ – ― ‥ ‵ ℅ ℉ ↖ ↗ ↘ ↙ ∕ ∟ ∣ 
 47 $A850 ≒ ≦ ≧ ⊿ ═ ║ ╒ ╓ ╔ ╕ ╖ ╗ ╘ ╙ ╚ ╛ 
 48 $A860 ╜ ╝ ╞ ╟ ╠ ╡ ╢ ╣ ╤ ╥ ╦ ╧ ╨ ╩ ╪ ╫ 
 49 $A870 ╬ ╭ ╮ ╯ ╰ ╱ ╲ ╳ ▁ ▂ ▃ ▄ ▅ ▆ ▇    
 50 $A880 █ ▉ ▊ ▋ ▌ ▍ ▎ ▏ ▓ ▔ ▕ ▼ ▽ ◢ ◣ ◤ 
 51 $A890 ◥ ☉ ⊕ 〒 〝 〞  
 52 
 53 code  +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F 
 54 $A940 〡 〢 〣 〤 〥 〦 〧 〨 〩 ㊣ ㎎ ㎏ ㎜ ㎝ ㎞ ㎡ 
 55 $A950 ㏄ ㏎ ㏑ ㏒ ㏕ ︰ ¬ ¦  ℡ ㈱  ‐    
 56 $A960 ー ゛ ゜ ヽ ヾ 〆 ゝ ゞ ﹉ ﹊ ﹋ ﹌ ﹍ ﹎ ﹏ ﹐ 
 57 $A970 ﹑ ﹒ ﹔ ﹕ ﹖ ﹗ ﹙ ﹚ ﹛ ﹜ ﹝ ﹞ ﹟ ﹠ ﹡    
 58 $A980 ﹢ ﹣ ﹤ ﹥ ﹦ ﹨ ﹩ ﹪ ﹫        
 59 $A990       〇 
 60 
 61 
 62 
 63 procedure Tfm_Words.Button4Click(Sender: TObject);
 64 var
 65   A, B: Cardinal;
 66   I, J: Integer;
 67   sHex: string;
 68   s1: WideString;
 69   ss: string;
 70 begin   //GBK/4: 0xAA40~0xFEA0(部分) 扩充汉字 包括繁体
 71   ss := #13#10+
 72         '                GBK/4: $AA40~$FEA0(部分) 扩充汉字全表                '#13#10+
 73         '                                           jfyes 2008-07-07'#13#10#13#10;
 74 
 75   for  I:=  $AA to $FE do
 76   begin
 77 
 78      for J := $40 to $A0 do
 79      begin
 80 
 81        sHex := Format('$%.2x%.2x', [I, J]);
 82        A := SysUtils.StrToIntDef(sHex, 0);
 83        
 84        if J = $40 then
 85          ss := ss+ 'code  +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F ';
 86 
 87 
 88        if J in [$40, $50,$60, $70, $80,$90, $A0, $B0, $C0, $D0, $E0, $F0] then
 89          ss := ss + #13#10 + sHex+ #32;
 90 
 91        if J <> $7F then
 92          ss := ss + Char(I) + Char(J) + #32
 93        else ss := ss + #32#32#32
 94 
 95 
 96      end;
 97      ss := ss + #13#10#13#10;
 98   end;
 99 
100 self.memo1.lines.add(ss, True);
101 end;
102 执行结果如下:
103 ------------------------------------------------------------
104 
105                 GBK/4: $AA40~$FEA0(部分) 扩充汉字全表  

 

标签:10,13,0xAA40,32,delphi,GBK,汉字,ss
From: https://www.cnblogs.com/jfyes/p/18046046

相关文章

  • delphi 新版内存表 FDMemTable
    https://www.yii666.com/article/173784.html procedureTForm6.Button1Click(Sender:TObject);vari:Integer;beginforI:=0toFDMemTable1.SourceView.Rows.Count-1dobeginCaption:=FDMemTable1.SourceView.Rows.ItemsI[i].GetData(1);end;end;pro......
  • delphi Byte 与 字符串(AnsiString、WideString) 相互转换
    Byte与字符串(AnsiString、WideString)相互转换代码String转ByteprocedureTForm1.Button1Click(Sender:TObject);varbuf:TBytes;I:Integer;begin//ANSI编码buf:=BytesOf('测试内容');Memo1.Lines.Add('ANSI编码');forI:=0toLength(buf)......
  • Delphi调用BPL并显示窗体
    bplunitUnit2;interfaceusesWinapi.Windows,Winapi.Messages,System.SysUtils,System.Variants,System.Classes,Vcl.Graphics,Vcl.Controls,Vcl.Forms,Vcl.Dialogs,Vcl.StdCtrls;typeTForm2=class(TForm)Label1:TLabel;Button1:TBu......
  • delphi 提高unigui开发效率的两个方法
    1、编译时自己退出运行的程序。在做unigui开发时,每次编译运行时,unigui的应用都会在后台运行,每次重新编译时都必须手工在任务栏里将应用退出才行,非常麻烦,可以在项目编译的参数里加上杀进程的命令,这样每次重新编译时就会自动将旧的进程杀掉。命令参数如下:taskkill/f/im$(OUTPUT......
  • delphi Byte 与 AnsiChar、WideChar 相互转换
    Byte与AnsiChar、WideChar相互转换代码Byte转AnsiChar、WideCharprocedureTForm1.Button1Click(Sender:TObject);varac:AnsiChar;wc:WideChar;bys:TBytes;begin//ANSI编码ac:='a';bys:=BytesOf(ac);Memo1.Lines.Add(bys[0].ToString);......
  • delphi10.3农历日历控件安装使用
    控件下载,链接: https://pan.baidu.com/s/1-ZJFRMT2z5_kti0LX7bHCw提取码:2anv  Delphi10.3在File菜单下,选择”OPEN…”打开ChnCalendars.dpk文件    打开自带DemoD:\迅雷下载\ChnCalendar3.0Beta20......
  • delphi7农历日历控件安装使用。
    链接:https://pan.baidu.com/s/1-ZJFRMT2z5_kti0LX7bHCw提取码:2anv  Delphi7在File菜单下,选择”OPEN…”打开ChnCalendars.dpk文件    ......
  • delphi 每年、月、周、日的开始与结束的时间
    delphi每年、月、周、日的开始与结束的时间2022-07-1911:00:00网络Delphi1900 本文整理自网络,侵删。StartOfAYear...StartOfTheYear...EndOfAYear...EndOfTheYear...每年、月、周、日的开始与结束的时间{参数是指定的年、月、周、日}DateUtils.Start......
  • 如何让.NET Core支持GB2312和GBK
    在.NETCore中,默认是不支持GB2312和GBK编码的。若果强制使用Encoding.GetEncoding(“GB2312”)的时候会抛出异常。所以在.NETCore中如果我们要使用GB2312和GBK编码,需要给项目引入一个Nuget包:包安装可以使用以下方法来添加System.Text.Encoding.CodePages:VisualStudio......
  • Delphi 实现刘谦春晚魔术
    试试看programProject1;{$APPTYPECONSOLE}{$R*.res}usesSystem.SysUtils,System.Classes;varlist,removeElement:TStringList;i,NameCount,insertIndex,directCount,sexCount:Integer;tmp,element,hiddenEle1,hiddenEle2:String;procedur......