|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer|
Unicode and MBCS
The Microsoft Foundation Class Library (MFC), the C run-time library for Visual C++, and the Visual C++ development environment are enabled to assist your international programming. They provide:
- Support for the Unicode standard on Windows 2000 (formerly Windows NT).
Unicode is a 16-bit character encoding, providing enough encodings for all languages. All ASCII characters are included in Unicode as "widened" characters.
Note The Unicode standard is not supported on Windows 95, Windows 98, or Windows Millennium Edition (ME).
- Support for a form of Multibyte Character Set (MBCS) called Double Byte Character Set (DBCS) on all platforms.
DBCS characters are composed of one or two bytes. Some ranges of bytes are set aside for use as "lead bytes." A lead byte specifies that it and the following "trail byte" comprise a single two-byte-wide character. You must keep track of which bytes are lead bytes. In a particular multibyte-character set, the lead bytes fall within a certain range, as do the trail bytes. When these ranges overlap, it may be necessary to evaluate the context to determine whether a given byte is functioning as a lead byte or a trail byte.
- Support for tools that simplify MBCS programming of applications written for international markets.
When run on an MBCS-enabled version of the Windows operating system, the Visual C++ development system — including the integrated source code editor, debugger, and command line tools — is completely MBCS-enabled. For more information, see MBCS Support in Visual C++.
Note In this documentation, "MBCS" is used to describe all non-Unicode support for multibyte characters. In Visual C++, MBCS always means DBCS. Character sets wider than two bytes are not supported.
By definition, the ASCII character set is a subset of all multibyte-character sets. In many multibyte character sets, each character in the range 0x00 – 0x7F is identical to the character that has the same value in the ASCII character set. For example, in both ASCII and MBCS character strings, the one-byte NULL character ('\0') has value 0x00 and indicates the terminating null character.