Unicode in Microsoft Windows: Difference between revisions

Content deleted Content added
m matched tenses
m Small edits to improve grammar and flow of English - no change of meaning.
Line 4:
== In various Windows families ==
=== Windows NT based systems ===
Modern operating systems like [[Windows XP]] and [[Windows Server 2003]], and prior to them as [[Windows NT]] (3.x, 4.0) and Windows 2000 are shipped with the [[Windows API|system libraries]], which support string [[character encoding|encoding]] of two types: UTF-16 (often called "Unicode" in Windows documentation) and an 8-bit encoding called the "[[Windows code page|code page]]" (or incorrectly referred to as ''ANSI code page''). 16-bit functions have names suffixed with -W (from [[wide character|"wide"]]), for example, lstrlenW(). Code page oriented functions uses suffix -A, e.g., lstrlenA(), for "ANSI". This split was necessary because many languages, including C, do not provide a clean way to pass both 8-bit and 16-bit strings to the same api or put them in the same structure. Windows also provides the 'M' API which in some locales provided multi-byte encodings, but in most locales is the same as 'a'. Most of such "A" and "M"-functions are implemented as a [[Wrapper function|wrapper]] that translates the code page to UTF-16 and calls the "W" functions.
 
The <code>IsTextUnicode</code> function uses a [[heuristic algorithm]] on a [[byte string]] passed to it to detect whether this string represents UTF-16 text. For very short texts, this function, used by some applications like [[Notepad (software)|Notepad]], often gives incorrect results. This gave rise to legends about the existence of [[Easter egg (computing)|"Easter eggs"]] like [[Bush hid the facts]].