function GB_BIG5(Value: string; bFull: Boolean = True): string;
var
Len: Integer;
s1, s2: string;
ws: WideString;
begin
Result := '';
Len := MultiByteToWideChar(936, 0, PChar(Value), -1, nil, 0);
SetLength(s1, Len * 2 + 1);
Len := LCMapString($0804, LCMAP_TRADITIONAL_CHINESE, PChar(Value), -1,
PChar(s1), Len * 2);
if bFull then
begin
SetLength(ws, Len);
MultiByteToWideChar(936, 0, PChar(s1), -1, PWideChar(ws), Len);
Len := WideCharToMultiByte(950, 0, PWideChar(ws), -1, nil, 0, nil, nil);
SetLength(s2, Len);
Len := WideCharToMultiByte(950, 0, PWideChar(ws), -1, PChar(s2),
Len, nil, nil);
Result := Copy(s2, 1, Len);
end
else
Result := Copy(s1, 1, Len);
Result := Trim(Result);
end;
function BIG5_GB(Value: string; bFull: Boolean = True): string;
var
Len: Integer;
s1, s2: string;
ws: WideString;
begin
if bFull then
begin
Len := MultiByteToWideChar(950, 0, PChar(Value), -1, nil, 0);
SetLength(ws, Len + 1);
MultiByteToWideChar(950, 0, PChar(Value), -1, PWideChar(ws), Len);
Len := WideCharToMultiByte(936, 0, PWideChar(ws), -1, nil, 0, nil, nil);
SetLength(s1, Len + 1);
SetLength(s2, Len + 1);
WideCharToMultiByte(936, 0, PWideChar(ws), -1, PChar(s1), Len, nil, nil);
Len := LCMapString($0804, LCMAP_SIMPLIFIED_CHINESE, PChar(s1), -1, PChar(s2), Len);
Result := Copy(s2, 1, Len);
end
else
begin
Len := MultiByteToWideChar(936, 0, PChar(Value), -1, nil, 0);
SetLength(s1, Len * 2 + 1);
Len := LCMapString($0804, LCMAP_SIMPLIFIED_CHINESE, PChar(Value), -1, PChar(s1), Len * 2);
Result := Copy(s1, 1, Len);
end;
Result := Trim(Result);
end;