现象:

今天敲代码突然遇到这样一个警告:

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的更多相关文章

  1. Compiler Warning (level 3) C4800

    #pragma warning( disable : 4800 ) // forcing bool 'true' or 'false' ,忽略4800 警告#pragma warning( disab ...

  2. Visual Studio低版本升级到Visual Studio 2012出现Warning LNK4075

    Warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/SAFESEH' specification

  3. Compiler Warning (level 2) CS0436

    https://docs.microsoft.com/en-us/dotnet/csharp/misc/cs0436 // CS0436_a.cs // compile with: /target:l ...

  4. 问题解决——warning C4503 超出修饰名的长度,名称被截断

    ========================声明============================ 本文原创,转载请注明作者和出处,并保证文章的完整性(包括本声明). 本文不定期修改完善,为 ...

  5. iOS.ObjC.Compiler.Directives

    Objective-C Compiler Directives @dynamic "You use the @dynamic keyword to tell the compiler tha ...

  6. 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 ...

  7. 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 ...

  8. C++ Core Guidelines

    C++ Core Guidelines September 9, 2015 Editors: Bjarne Stroustrup Herb Sutter This document is a very ...

  9. 【转】My App Crashed, Now What? – Part 1

    原文地址:http://www.raywenderlich.com/10209/my-app-crashed-now-what-part-1  By Matthijs Hollemans on Mar ...

随机推荐

  1. [PATCH] UBUNTU: SAUCE: (no-up) apparmor: Sync to apparmor3 - RC1(v3.4.x kernel)

    ubuntu touch v3.4 kernel AppArmor v3 backport patch 地址1:https://github.com/multirom-aries/ubuntu-pho ...

  2. [置顶] 最优间隔分类器、原始/对偶问题、SVM的对偶问题——斯坦福ML公开课笔记7

    转载请注明:http://blog.csdn.net/xinzhangyanxiang/article/details/9774135 本篇笔记针对ML公开课的第七个视频,主要内容包括最优间隔分类器( ...

  3. Codeforces Round #256 (Div. 2) A. Rewards

    A. Rewards time limit per test 1 second memory limit per test 256 megabytes input standard input out ...

  4. DP:树DP

    The more, The Better Time Limit: 6000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Oth ...

  5. ios-html-get/post差额,简而言之(MS)CheckST

    get直接采取拉数据,post注射剂server.至server安全或使用get 而且由于get明确传递,password帐户A眼可以看得出来,甚至加密也可以很easy解,所以传password用po ...

  6. UIScrollViewA都PI得知。

    //1.设定滚定条的样式 typedef NS_ENUM(NSInteger, UIScrollViewIndicatorStyle) { UIScrollViewIndicatorStyleDefa ...

  7. Harry Potter and the Prisoner of Azkaban

    称号:Harry Potter and the Prisoner of Azkaban 作者:J.K. Rowling 篇幅: 448页 蓝思值:880L 用时:    11天 工具:  有道词典 [ ...

  8. HIPO图

    HIPO图(Hierarchy Plus Input/Processing/Output)是表示软件结构的一种图形工具.以模块分解的层次性以及模块内部输入.处理.输出三大基本部分为基础建立的.它由两部 ...

  9. [Unity3D]脚本中Start()和Awake()的差别

    Unity3D刚開始学习的人常常把Awake和Start混淆. 简单说明一下,Awake在MonoBehavior创建后就立马调用,Start将在MonoBehavior创建后在该帧Update之前. ...

  10. 读书时间《JavaScript高级程序设计》五:DOM

    DOM(文档对象模型)是针对HTML文档的一个API,描绘了一个层次化的节点树,可以添加.移除.修改页面的某一部分. 一个简单的文档结构 <!DOCTYPE html> <html& ...