开发者

Convert iso_8859_1 string to win1253 with delphi xe

How can i do this conversion wi开发者_如何学JAVAth delphi xe? I've tried using libiconv2 but didn't worked.


Using Dephi's built-in AnsiString charset support is best:

type
  // ISO-8859-1 and Windows-1252 are NOT the same, but
  // are commonly interchanged when they should not be!
  Latin1String = type AnsiString(28591);
  Windows1252String = type AnsiString(1252);
  GreekString = type AnsiString(1253);

procedure DoIt;
var
  S1: Latin1String;
  S2: Windows1252String;
  S3: GreekString;
begin
  S1 := '...'; // auto-converts to ISO-8859-1
  S2 := S1; // auto-converts from ISO-8859-1 to Unicode to Windows-1252
  S3 := S1; // auto-converts from ISO-8859-1 to Unicode to Greek
end; 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜