Multibyte and Wide Characters

在MSDN上的介绍

 

A multibyte character is a character composed of sequences of one or more bytes. Each byte sequence represents a single character in the extended character set. Multibyte characters are used in character sets such as Kanji.

Wide characters are multilingual character codes that are always 16 bits wide. The type for character constants is char; for wide characters, the type is wchar_t. Since wide characters are always a fixed size, using wide characters simplifies programming with international character sets.

The wide-character-string literal L"hello" becomes an array of six integers of type wchar_t.

{L'h', L'e', L'l', L'l', L'o', 0}

The Unicode specification is the specification for wide characters. The run-time library routines for translating between multibyte and wide characters include mbstowcs, mbtowc, wcstombs, and wctomb.

 

See Also
Reference

wide   characters指的是双字节表示一个字符。 
multibyte   characters指的是多字节表示一个字符。
wide   character是指全部用两个字节代表一个字符,即使这个字符是ASCII标准字符也必须用两个字节,如‘A '用0x41即可,但在wide   character中它必须为0x0041,这样结尾符也由0x00,变成了0x0000. 

multibyte   characters是MS制定的标准,界于UNICODE和ANSI字符之间,所有小于127的字符都用一个字节表示自己,如‘A '用0x41即可;所有大于127字符都表示它是个领头字节,将同后面一个字节联合起来表示一个字符,如中文字符。因此它的结尾符只需一个字节0x00. 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值