VisualC++2012 Compiler Warning C4566
来源:互联网 发布:marja kurki 知乎 编辑:程序博客网 时间:2024/06/16 21:26
现象:
今天写程序突然遇到这样一个警告:
warning C4566: ユニバーサル文字名 '\u0642' によって表示されている文字は、現在のコード ページ (932) で表示できません
意思是说,Unicode字符'\u0642'不能在现在的codepage(932)中 表示。(codepage(932)表示日文编码JIS)
结论:
查了一下微软官方的描述,并不是每一个Unicode字符都能在你当前的ANSI code page中表示,存在有一部分字符肯定表示不了。单字符是可以转成宽字符,反之则不行。
示例:
下面示例中c1,c2编译时都会出C4566,我们应该以宽字符去存储Unicode字符
// Warning_C4566.cpp : コンソール アプリケーションのエントリ ポイントを定義します。//#include "stdafx.h"#include <stdio.h>int _tmain(int argc, _TCHAR* argv[]){ //Unicode字符以当前ANSI(CodePage932)存入 char c1 = '\u521B'; // C4566 char c2 = '\u0642'; // C4566 char c3 = '\u03a0'; // NO C4566 //Unicode字符以宽自己存入 wchar_t c4 = L'\u521B'; // OK wchar_t c5 = L'\u0642'; // OK wchar_t c6 = L'\u03a0'; // OK return 0;}
0 0
- VisualC++2012 Compiler Warning C4566
- 学习笔记:解决 warning C4566
- C Compiler Warning Abstract
- Asset Catalog Compiler Warning Group
- warning C4566: 由通用字符名称“\u202A”表示的字符不能在当前代码页(936)中表示出来
- warning maven-compiler-plugin is missing
- 译文: C28x Compiler Error and Warning Messages
- 感受VisualC++2012的界面编程
- gcc compiler warning: “will be initialized after/when initialized here”
- WARNING: invalid compiler option –float_support=fpu32 (ignored)
- gcc compiler warning: “will be initialized after/when initialized here”
- compiler
- Compiler
- compiler
- Compiler Warning C4150: deletion of pointer to incomplete type 'XXX'; no destructor called
- maven编译插件maven-compiler-plugin误将WARNING当ERROR
- configure: WARNING: sys/capability.h: accepted by the compiler, rejected by the preprocessor!
- WARNING: Project ERROR: Cannot run compiler 'g++'. Maybe you forgot to setup the environment?
- Java中的基本数据类型
- 给ubuntu设置root密码
- jQuery:如何创建一个最基本的插件(How to Create a Basic Plugin)
- Spring与RESTful
- Unity 提取游戏资源之ktx转换
- VisualC++2012 Compiler Warning C4566
- getCurrentSession和openSession
- nagios配置
- DZY Loves Chessboard
- Android内存优化
- IOS 示例地址
- failed to lazily initialize a collection of role: could not initialize proxy - no Session
- 搭建Struts2开发环境
- OMXCodec与OMX事件处理流程