VS中语言属性对字符集转码的影响
属性文件能够显示特殊字符与以下两句最重要,第一句用于WIN32应用程序,第二句用于驱动程序
#pragma code_page(65001)
RCCODEPAGE=65001
Pragma 指令 - Win32 apps | Microsoft Docs
代码页标识符 - Win32 apps | Microsoft Docs
Language Identifiers - Win32 apps | Microsoft Docs
Win32应用程序
RC文件相关
VERSIONINFO 资源 - Win32 apps | Microsoft Docs
VERSIONINFO resource - Win32 apps | Microsoft Docs
Using RC (The RC Command Line) - Win32 apps | Microsoft Docs
使用 RC(RC 命令行) - Win32 apps | Microsoft Docs
从rc 命令 RCFLAGS = /l0x04b0 /c65001 /d_DEBUG
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "winres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// Language neutral resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU)
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
#pragma code_page(65001)
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#ifndef APSTUDIO_INVOKED
#include "targetver.h"
#endif
#define APSTUDIO_HIDDEN_SYMBOLS
#include "windows.h" //win32
#undef APSTUDIO_HIDDEN_SYMBOLS
//#include "afxres.h" //mfc
//#include "verrsrc.h" //mfc
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// Language neutral resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU)
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
#pragma code_page(65001)
BLOCK "000004b0"
VALUE "Translation", 0x0, 1200
驱动:
在文件Sources中定义
RC_DEFINES=$(RC_DEFINES) -DRCLANGUAGE=0
RCCODEPAGE=65001
本文探讨了Visual Studio中语言属性设置对于字符集转码的影响,并详细介绍了如何通过Pragma指令设置代码页,以确保特殊字符在不同类型的项目(如Win32应用程序和驱动程序)中正确显示。
1万+

被折叠的 条评论
为什么被折叠?



