Search results for 'Unicode Decoding'. 1 post(s) found.

  1. 2009/07/20 Delphi string conversion functions - AnsiToUTF-8, UTF8Encode, ...
2009/07/20 15:09

Delphi string conversion functions - AnsiToUTF-8, UTF8Encode, ...


Delphi already provide String Conversion functions variously. You just call conversion function.

function UnicodeToUtf8(Dest: PChar; Source: PWideChar; MaxBytes: Integer): Integer; overload; deprecated;

function Utf8ToUnicode(Dest: PWideChar; Source: PChar; MaxChars: Integer): Integer; overload; deprecated;

function UnicodeToUtf8(Dest: PChar; MaxDestBytes: Cardinal; Source: PWideChar; SourceChars: Cardinal): Cardinal; overload;

function Utf8ToUnicode(Dest: PWideChar; MaxDestChars: Cardinal; Source: PChar; SourceBytes: Cardinal): Cardinal; overload;

function UTF8Encode(const WS: WideString): UTF8String;

function UTF8Decode(const S: UTF8String): WideString;

function AnsiToUTF8(const S: string): UTF8String;

function UTF8ToAnsi(const S: UTF8String): string;

If you have problems in Delphi 2009, use above functions.
Trackback 0 Comment 0

Trackback : Cannot send a trackbact to this post.