UTF8Encode

Convert a widestring or unicodestring to an UTF-8 encoded ansistring

Declaration

Source position: ustringh.inc line 139

  function UTF8Encode(const s: RawByteString) : RawByteString;
  function UTF8Encode(const s: UnicodeString) : RawByteString;
  function UTF8Encode(const s: WideString) : RawByteString;

Description

UTF8Encode converts an ansistring or widestring S to the equivalent UTF-8 encoded Unicode string and returns this resulting string. It calls the low-level UnicodeToUTF8 function to do the actual work.

The resulting string has code page CP_UTF8.

See also

Name Description
SetWideStringManager Set the widestring manager
UnicodeToUtf8
UTF8Decode Convert an UTF-8 encoded ansistring to a unicodestring
Utf8ToAnsi Convert a UTF-8 encoded Unicode string to an ansistring