UTF-16 (16-bit Unicode Transformation Format) is a character encoding capable of encoding all 1,112,064 valid character code points of Unicode (in fact this number of code points is dictated by the design of UTF-16). The encoding is variable-length, as code points are encoded with one or two 16-bit code units.

What is the difference between UCS-2 and UTF-16?

UCS-2 is a fixed width encoding that uses two bytes for each character; meaning, it can represent up to a total of 216 characters or slightly over 65 thousand. On the other hand, UTF-16 is a variable width encoding scheme that uses a minimum of 2 bytes and a maximum of 4 bytes for each character.

How do I use Unicode in Delphi?

Using Unicode in your Delphi application. Unicode Encodings. Unicode consists of tens of thousands of characters, each of which has an unique code. To be able to store any Unicode characters you’ll need 4 bytes (a 32-bit value) for every characters. This encoding of Unicode is called UCS4.

What are the different types of strings in Delphi?

The following types are covered: A string represents a sequence of characters. Delphi supports the following predefined string types. Backward compatibility. 8-bit (ANSI) characters, DBCS ANSI, MBCS ANSI, Unicode characters, etc. Note: In RAD Studio, string is an alias for UnicodeString.

What is the maximum length of a string in Delphi?

The Delphi language supports short-string types – in effect, subtypes of ShortString – whose maximum length is anywhere from 0 to 255 characters. These are denoted by a bracketed numeral appended to the reserved word string. For example: creates a variable called MyString, whose maximum length is 100 characters.

Is widestring supported by the Delphi compilers?

WideString is not supported by the Delphi compilers for mobile platforms, but is supported by the Delphi compilers for desktop platforms. Using UnicodeString is preferred to WideString.