The source code is different from the original version.

本文介绍了解决Visual C++ 8 (VC8) 中警告C4819的方法,即文件中存在无法在当前代码页(936)中表示的字符,并提供了一种简单的方法来避免数据丢失。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

The source code is different from the original version.
我遇到的情况,竟然是这种情况:
d:/worksapce/dvdcopy-dll/dvdcopy/dvdfileset.cpp : warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss



中文VC8的程序员可能会常常看见这个warning:

warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失.

这个警告没有什么坏影响,但会影响心情:) 所以还是要治理一下:

哪个文件出现这个警告错误,打开它, 用VS2005的查找替换功能,打开允许正则表达式选项,选择当前窗口,查找替换 /n 为 /n ,  然后,这个世界就清净了。

原因: 查找的 /n 是跨平台的回车,替换的 /n 却是当前代码页的回车了




1)编译错误C2220和警告C4819
错误描述(在vs2005中,特别是查看别人的代码)
./crt_dbg1.c : error C2220: warning treated as error - no 'object' file generated
./crt_dbg1.c : warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss

修改方法:只需要对次文件 Ctrl+A ,Ctrl+X, 然后再 Ctrl+V就搞定。(使文件变为unicode)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值