level 3
比如 Unicode 的 “玩” 字 Unicode 编码 为29609 如何转成 ANSI 的数字编码 我用的是 DLEPHI
求给出 转成 Unicode 转成 ansi 数字编码 的方法
2014年12月01日 14点12分
1
吧务
level 14
var
aSourceLength, aDestLength: Integer;
begin
aSourceLength := Length(S);
if aSourceLength = 0 then
Result := ''
else
begin
aDestLength := LocaleCharsFromUnicode(936, 0, PWideChar(S), aSourceLength, nil, 0, nil, nil);
SetLength(Result, aDestLength);
if aDestLength > 0 then
LocaleCharsFromUnicode(936, 0, PWideChar(S), aSourceLength, PAnsiChar(@Result[1]), aDestLength, nil, nil);
end;
end;
2014年12月02日 00点12分
2
level 10
TEncoding.Ansi.GetBytes('玩')
2014年12月02日 01点12分
3
这个只能XE才能用
2014年12月05日 05点12分