Difference between revisions of "WideChar"

From Lazarus wiki
Jump to navigationJump to search
(modify to show that it usually holds a unicode character - not always.)
Line 1: Line 1:
 
A variable of type WideChar, which has a synonym of [[UnicodeChar]] ''(type UnicodeChar = WideChar;)'' , is exactly 2 bytes in size, and usually contains one Unicode character in UTF-16 encoding. As it is impossible to encode all Unicode code points (a code point normally corresponds to a character) in 2 bytes, two WideChars may be needed to encode a single code point. As of version 3 of Free Pascal, the [[Char]] datatype is a synonym for an [[AnsiChar]]. However, in the future the Free Pascal compiler may consider Char a synonym for WideChar.
 
A variable of type WideChar, which has a synonym of [[UnicodeChar]] ''(type UnicodeChar = WideChar;)'' , is exactly 2 bytes in size, and usually contains one Unicode character in UTF-16 encoding. As it is impossible to encode all Unicode code points (a code point normally corresponds to a character) in 2 bytes, two WideChars may be needed to encode a single code point. As of version 3 of Free Pascal, the [[Char]] datatype is a synonym for an [[AnsiChar]]. However, in the future the Free Pascal compiler may consider Char a synonym for WideChar.
 +
 +
 +
[[Category:Data types]]

Revision as of 19:52, 13 June 2016

A variable of type WideChar, which has a synonym of UnicodeChar (type UnicodeChar = WideChar;) , is exactly 2 bytes in size, and usually contains one Unicode character in UTF-16 encoding. As it is impossible to encode all Unicode code points (a code point normally corresponds to a character) in 2 bytes, two WideChars may be needed to encode a single code point. As of version 3 of Free Pascal, the Char datatype is a synonym for an AnsiChar. However, in the future the Free Pascal compiler may consider Char a synonym for WideChar.