Sign in Join
Wiki copytemporary

UnicodeString

Back to data types.

Back to Character and string types.

A data field of the data type UnicodeString has no size restriction and consists internally of an array of the UniCodeChar data type.

The functions of the LazUtf8 unit are required for problem-free type conversion from AnsiString to UnicodeString and from UnicodeString to AnsiString.

Unicode strings are used to display strings from the Unicode character set. Unicode strings are implemented in the same way as AnsiStrings and can be cast (converted) to the PUnicodeChar data type.

Definition of a data field of data type UnicodeString:

pascal
var 
  u : UnicodeString;
  a : AnsiString;

The examples below apply to the Windows operating system!

Examples for the valid assignment of AnsiString to WideString:

pascal
  u := UTF8ToUTF16('0123ABCabc456AöU!, .-');
  u := u + UTF8ToUTF16(IntToString(45));

Example of the valid assignment of WideString to AnsiString:

pascal
  a := UTF16ToUTF8(u);

From the Free Pascal wiki, page "UnicodeString", as it stood on 2023-12-22 after a change by Alextpp, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.

Revision 3, last changed by WikiArchive .

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.