System.TMarshal.AllocStringAsUtf8
Delphi
class function AllocStringAsUtf8(const Str: string): TPtrWrapper; overload;
class function AllocStringAsUtf8(S: PWideChar): TPtrWrapper; overload;
プロパティ
種類 | 可視性 | ソース | ユニット | 親 |
---|---|---|---|---|
function | public | System.pas | System | TMarshal |
説明
文字列をバッファにコピーします。
AllocStringAsUtf8 メソッドは、Str
のコピーを格納したバッファを参照する、ラップ ポインタを返しますが、この Str は、デフォルトのシングルバイト エンコーディングでエンコードされ、null で終了します。 バッファは、Flush が呼び出されるか、レコードがスコープの外にでた際に、解放されます。