Unicode and MBCS

The microsoft Foundation Classes(MFC) library,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)

NOTE: The Unicode standard is not supported on Windows 95,windows 98,WIndows millennum Edition.

Unicode is a 16-bit character encoding, providing enough encodings for all languages.All ASCII characters are included in Unicode as widened characters.

  MBCS is shorted for multibyte character set ,called double-byte character set(DBCS) on all microsoft platforms.DBCS characters are composed of 1 or 2 bytes.

Some ranges of bytes are set aside for use as lead bytes.A lead bytes specifies that it and the following trail byte comprise a single-2-byte character.

MBCS is used to describe all non-Unicode support for multibyte character ,In visual c++ ,MBCS always means DBCS.Character sets wider than 2 bytes are not supported.

  The MBCS with Visual C++

    When run on an MBCS-enabled version of the WIndows 2000 or XP OS, the visual c++ development system(including the integrated source code editor,debugger,and command line tools) is MBCS-enabled,with the exception of the memory window.

     The memory window does not interpret bytes of data as MBCS characters, even though it can interpret them as ANSI or Unicode characters. ANSI characters are always 1 byte in size and Unicode characters are 2 bytes in size. With MBCS, characters can be 1 or 2 bytes in size and their interpretation depends on which code page is in use. Because of this, it is difficult for the memory window to reliably display MBCS characters. The memory window cannot know which byte is the start of a character. The developer can view the byte values in the memory window and look up the value in tables to determine the character representation. This is possible because the developer knows the starting address of a string based on the source code.

Visual C++ accepts double-byte characters wherever it is appropriate to do so. This includes path names and file names in dialog boxes and text entries in the Visual C++ resource editor (for example, static text in the dialog editor and static text entries in the icon editor). In addition, the preprocessor recognizes some double-byte directives — for example, file names in #include statements, and as arguments to the code_seg and data_seg pragmas. In the source code editor, double-byte characters in comments and string literals are accepted, although not in C/C++ language elements (such as variable names).

  







  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值