VisualC++2012 Compiler Warning C4566
现象:
今天敲代码突然遇到这样一个警告:
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;
}
版权声明:本文博主原创文章,博客,未经同意不得转载。
VisualC++2012 Compiler Warning C4566的更多相关文章
- Compiler Warning (level 3) C4800
#pragma warning( disable : 4800 ) // forcing bool 'true' or 'false' ,忽略4800 警告#pragma warning( disab ...
- Visual Studio低版本升级到Visual Studio 2012出现Warning LNK4075
Warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/SAFESEH' specification
- Compiler Warning (level 2) CS0436
https://docs.microsoft.com/en-us/dotnet/csharp/misc/cs0436 // CS0436_a.cs // compile with: /target:l ...
- 问题解决——warning C4503 超出修饰名的长度,名称被截断
========================声明============================ 本文原创,转载请注明作者和出处,并保证文章的完整性(包括本声明). 本文不定期修改完善,为 ...
- iOS.ObjC.Compiler.Directives
Objective-C Compiler Directives @dynamic "You use the @dynamic keyword to tell the compiler tha ...
- Win7 64位 php-5.5.13+Apache 2.4.9+mysql-5.6.19 配置
一 :准备阶段 1:php php-5.5.13下载链接:http://windows.php.net/downloads/releases/php-5.5.13-Win32-VC11-x64.zip ...
- QT 4.87 changes
http://blog.qt.io/blog/2015/05/26/qt-4-8-7-released/ Qt 4.8.7 is a bug-fix release. It maintains bot ...
- C++ Core Guidelines
C++ Core Guidelines September 9, 2015 Editors: Bjarne Stroustrup Herb Sutter This document is a very ...
- 【转】My App Crashed, Now What? – Part 1
原文地址:http://www.raywenderlich.com/10209/my-app-crashed-now-what-part-1 By Matthijs Hollemans on Mar ...
随机推荐
- Basic脚本解释器移植到STM32
本文来自http://blog.csdn.net/hellogv/ .引用必须注明出处! 上次讲了LUA移植到STM32.这次讲讲Basic脚本解释器移植到STM32. 在STM32上跑Basic脚本 ...
- 关闭 sqlserver提示信息
- 【原创】leetCodeOj --- Copy List with Random Pointer 解题报告
题目地址: https://oj.leetcode.com/problems/copy-list-with-random-pointer/ 题目内容: A linked list is given s ...
- 说说nio2
利不百不变法,功不十不易器 为什么会出现nio,之前的io有什么问题? 请先看 说说nio1 nio类图例如以下 watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZX ...
- HDU 2815 Mod Tree 离散对数 扩张Baby Step Giant Step算法
联系:http://acm.hdu.edu.cn/showproblem.php?pid=2815 意甲冠军: watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQ ...
- 2014在百度之星资格赛的第二个问题Disk Schedule
事实上,我认为它可以用来费用流问题.但光建地图上加班. ..不科学啊.. . 因副作用太大,否则,必然在.最后,想啊想,或者使用dp对.... 别想了一维dp... .我不知道我是怎么想.无论如何,这 ...
- Lua 数据库访问(转)
本文主要为大家介绍 Lua 数据库的操作库:LuaSQL.他是开源的,支持的数据库有:ODBC, ADO, Oracle, MySQL, SQLite 和 PostgreSQL. 本文为大家介绍MyS ...
- windows API与C#的数据类型对应关系表
API与C#的数据类型对应关系表 API数据类型 类型描述 C#类型 API数据类型 类型描述 C#类型 WORD 16位无符号整数 ushort CHAR 字符 char LONG 32位无符号整数 ...
- Java下拼接执行动态SQL语句(转)
在实际业务中经常需要拼接动态SQL来完成复杂数据计算,网上各类技术论坛都有讨论,比如下面这些问题: http://bbs.csdn.net/topics/390876591 http://bbs.cs ...
- some notions about os
1. Multiprogramming system provide an environment in which the various resources (like CPU,memory,an ...