[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'System' (#rtl)

Utf8ToUnicode

Convert a buffer with UTF-8 characters to widestring characters

Declaration

Source position: line 0

function Utf8ToUnicode(

  Dest: PUnicodeChar;

  Source: PChar;

  MaxChars: SizeInt

):SizeInt;

function Utf8ToUnicode(

  Dest: PUnicodeChar;

  MaxDestChars: SizeUInt;

  Source: PChar;

  SourceBytes: SizeUInt

):SizeUInt;

function Utf8ToUnicode(

  Dest: PWideChar;

  Source: PChar;

  MaxChars: SizeInt

):SizeInt;

function Utf8ToUnicode(

  Dest: PWideChar;

  MaxDestChars: SizeUInt;

  Source: PChar;

  SourceBytes: SizeUInt

):SizeUInt;

Description

Utf8ToUnicode converts the buffer in Source with a length of SourceBytes or for a maximum length of MaxChars (or MaxDestChars) widestring characters to the buffer pointed to by Dest.

The function returns the number of copied widestring characters.

For this function to work, a widestring manager must be installed.

Errors

On error, -1 is returned.

See also

UTF8Encode

  

Convert a UTF-8 encoded unicode string to a widestring

UTF8Decode

  

Convert a widestring to a UTF-8 encoded unicode string

Utf8ToAnsi

  

Convert a UTF-8 encoded unicode string to an ansistring

SetWideStringManager

  

Set the widestring manager

The latest version of this document can be found at lazarus-ccr.sourceforge.net.