System.UTF8ToString

提供: RAD Studio API Documentation
移動先: 案内検索

Delphi

function UTF8ToString(const S: _RawByteStr): string;
function UTF8ToString(const S: _ShortStr): string;
function UTF8ToString(const S: _PAnsiChr): string;
function UTF8ToString(const S: array of Byte): string; overload;

C++

extern DELPHI_PACKAGE UnicodeString __fastcall UTF8ToString(const RawByteString S)/* overload */;

プロパティ

種類 可視性 ソース ユニット
function public
System.pas
System.hpp
System System


説明

UTF-8 エンコード文字列を文字列に変換します。

UTF8ToString を呼び出すと、UTF-8 エンコードの文字列を文字列に変換できます。 S は、UTF-8 エンコード文字の文字列または配列で、次の形式をとることができます:

この関数の結果は、対応するデコードされた文字列値となります。

注意: UTF8ToString(const S: _PAnsiChr) メソッドは削除されました。UTF8ToStringAnsiChar静的配列で呼び出すコードは想定通り動作します。UTF8ToStringAnsiChar動的配列で呼び出すコードは今後コンパイルされません。動的配列については、以下のように配列を PAnsiChar にキャストするか、UTF8ArrayToString を使用してください。
var
  Buffer: array of AnsiChar; // Or TArray<AnsiChar>
begin
  ...
  UTF8ToString(PAnsiChar(Buffer));

関連項目