Unit 'msestrings' Package
[Overview][Constants][Types][Classes][Procedures and functions][Index] [#msegui]

utf8tostring

Converts an UTF-8 encoded string to msestring (UCS2)

Declaration

Source position: msestrings.pas line 610

function utf8tostring(

  const value: pchar;

  const alength: Integer;

  const options: utfoptionsty = []

):msestring;

function utf8tostring(

  const value: pchar;

  const options: utfoptionsty = []

):msestring;

function utf8tostring(

  const value: lstringty;

  const options: utfoptionsty = []

):msestring;

function utf8tostring(

  const value: utf8string;

  const options: utfoptionsty = []

):msestring;

Description

Converts an UTF-8 encoded string to msestring (UCS2).

Beware of the utf8string overload: if an ansistring is passed, the compiler first converts it silently from the system code page to UTF-8, which damages the text when the bytes are already UTF-8 and the system code page is not (e.g. Windows, or LANG=C). Use utf8tostringansi in that case. In a unit using msestrings, an unqualified utf8tostring refers to this function; write system.utf8tostring for the FPC one.


Documentation generated on: 2026-10-03