首页 > 其他 > 详细

UNICODE和_UNICODE的区别

时间:2015-04-03 06:51:47      阅读:155      评论:0      收藏:0      [点我收藏+]


经google,找到如下:

The plain versions without the underscore affect the character set the Windows header files treat as default. So if you define UNICODE, then GetWindowText will map to GetWindowTextW instead of GetWindowTextA, for example. Similarly, the TEXT macro will map to L"..." instead of "...".

The versions with the underscore affect the character set the C runtime header files treat as default. So if you define _UNICODE, then _tcslen will map to wcslen instead of strlen, for example. Similarly, the _TEXT macro will map to L"..." instead of "...".


Looking into Windows SDK you will find things like this:

#ifdef _UNICODE
#ifndef UNICODE
#define UNICODE
#endif
#endif

以上大意就是:没带下划线的UNICODE主要是针对Windows的头文件。

              带下划线的_UNICODE主要是针对C运行库的。

所以自定义时,最好两种都应定义。


UNICODE和_UNICODE的区别

原文:http://whatever957.blog.51cto.com/6835003/1627843

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!