wcstombs() 把宽字符串转换为多字节字符串的问题

mark521 2005-04-20 05:22:42
宽字符串是什么概念,多字节字符串又是什么概念啊?
看不明白,望各位指点迷津
...全文
89 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
FromNoWhere 2005-04-20
  • 打赏
  • 举报
回复
Kanji is the chinese charactor used by Japanese, u can think it as Japanese charactors.

also here is another great page describing ur problem:

http://www.chemie.fu-berlin.de/chemnet/use/info/libc/libc_18.html
FromNoWhere 2005-04-20
  • 打赏
  • 举报
回复
Below are from:
http://www-ccs.ucsd.edu/c/charset.html

Multibyte Characters
A source character set or target character set can also contain multibyte characters (sequences of one or more bytes). Each sequence represents a single character in the extended character set. You use multibyte characters to represent large sets of characters, such as Kanji. A multibyte character can be a one-byte sequence that is a character from the basic C character set, an additional one-byte sequence that is implementation defined, or an additional sequence of two or more bytes that is implementation defined.


Wide-Character Encoding
Each character in the extended character set also has an integer representation, called a wide-character encoding. Each extended character has a unique wide-character value. The value zero always corresponds to the null wide character. The type definition wchar_t specifies the integer type that represents wide characters.

You write a wide-character constant as L'mbc', where mbc represents a single multibyte character. You write a wide-character string literal as L"mbs", where mbs represents a sequence of zero or more multibyte characters. The wide-character string literal L"xyz" becomes a sequence of wide-character constants stored in successive bytes of memory, followed by a null wide character:
{L'x', L'y', L'z', L'\0'}

You can also refer to
http://publib.boulder.ibm.com/infocenter/pseries/index.jsp?topic=/com.ibm.vacpp7a.doc/standlib/ref/mbchar.htm
for more information.


64,644

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧