MultiByteToWideChar中指定codepage用来做什么?

unique_man 2009-06-16 08:43:07
我调用这个函数时,指定codepage为CP_ACP或者CP_UTF8有什么区别?
操作系统用这个来做了些什么?
...全文
205 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
arong1234 2009-06-16
  • 打赏
  • 举报
回复
简单的说,同样的编码,在不同的代码页中的含义是不一样的,在一个代码页中0x1234可能表示符号x,在另外一个代码页中可能完全是另外一个意思,所以必须提供代码页才能解释一个字符是什么意思

就好像“ta”在中文汉语拼音中表示“它”,而在英文中表示“谢谢”,如果你不说明在哪个环境中,ta是毫无意义的
lfm13720 2009-06-16
  • 打赏
  • 举报
回复
CodePage
[in] Specifies the code page to be used to perform the conversion. This parameter can be given the value of any code page that is installed or available in the system. You can also specify one of the values shown in the following table. Value Meaning
CP_ACP ANSI code page
CP_MACCP Macintosh code page
CP_OEMCP OEM code page
CP_SYMBOL Windows 2000/XP: Symbol code page (42)
CP_THREAD_ACP Windows 2000/XP: The current thread's ANSI code page
CP_UTF7 Windows 98/Me, Windows NT 4.0 and later: Translate using UTF-7
CP_UTF8 Windows 98/Me, Windows NT 4.0 and later: Translate using UTF-8. When this is set, dwFlags must be zero.

65,211

社区成员

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

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