GB和BIG5的汉字对照文件

I

import

Unregistered / Unconfirmed
GUEST, unregistred user!
GB和BIG5的汉字对照文件
实际上这不是真正的繁体,而是GBK支持的大字符集的对应繁体字。
感谢齐齐 <richmy@163.net>友情提供。
简体.txt是简体中文,繁体.txt是繁体中文
排列规则,比如简体“台”字在简体.txt里第五行第二列,那么在繁体.txt里的第
五行第二列就可以找到繁体字“臺”字
简体与繁体字是相对应的。
下面是Kingron写的一个翻译函数:
function GbToBig5(CCh: string): string;
var
GB, Big: TStrings;
P: integer;
Offset: integer;
ExeDir: string;
Len: integer;
C: string;
begin
P := 1;
ExeDir := ExtractFilePath(ParamStr(0));
GB := TStringList.Create;
GB.LoadFromFile(ExeDir + '/u31616简体.txt');
Big := TStringList.Create;
Big.LoadFromFile(ExeDir + '/u32321繁体.txt');
SetLength(C, 2);
Len := Length(CCh);
SetLength(Result, Len);
try
while P <= Len do
begin
case ByteType(CCh, P) of
mbSingleByte: Result[P] := CCh[P];
mbLeadByte: begin
C[1] := CCh[P];
C[2] := CCh[P + 1];
Offset := AnsiPos(C, Gb.Text);
if Offset<>0 then
begin
Result[P] := Big.Text[Offset];
Result[P + 1] := Big.Text[Offset + 1];
end
else
begin
Result[P] := CCh[P];
Result[P + 1] := CCh[P + 1];
end;
Inc(P);
end;
end;
Inc(P);
end;
finally
GB.Free;
Big.Free;
end;
end;
目前没有时间,不然的话,做成一个DLL即可。
 
附件&gt;&gt;&gt;&gt; <a href="汉字对照.rar" target="_blank">汉字对照.rar</a>
 

Similar threads

S
回复
0
查看
603
SUNSTONE的Delphi笔记
S
S
回复
0
查看
577
SUNSTONE的Delphi笔记
S
I
回复
0
查看
864
import
I
I
回复
0
查看
572
import
I
I
回复
0
查看
470
import
I
顶部