System.TMarshal.AllocStringAsUtf8

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

class function AllocStringAsUtf8(const Str: string): TPtrWrapper; overload;
class function AllocStringAsUtf8(S: PWideChar): TPtrWrapper; overload;

Properties

Type Visibility Source Unit Parent
function public System.pas System TMarshal

Description

Copies a string into a buffer.

The AllocStringAsUtf8 method returns a wrapped pointer referencing a buffer containing a copy of Str encoded in the default single byte encoding, with a null terminator. The buffer will be freed when Flush is called or the record goes out of scope.


See Also