首页 > 其他分享 >【GiraKoo】VS提示Some bytes have been replaced with the Unicode substitution character

【GiraKoo】VS提示Some bytes have been replaced with the Unicode substitution character

时间:2023-06-28 16:01:27浏览次数:46  
标签:GiraKoo UTF Some bytes VS Unicode substitution character

【问题解决】VS提示Some bytes have been replaced with the Unicode substitution character

VS提示Some bytes have been replaced with the Unicode substitution character while loading file xxxxx with Unicode(UTF-8) encoding. Saving the file will not preserve the original file contents.
中文意思,是在打开xxxxx文件时,部分字符被替换成Unicode(UTF-8)格式,保存文件将会无法保留原来的内容(原来的内容将会被替换成Unicode)
Visual Studio报错提示

【背景】

在Visual Studio 2022版本中,打开非UTF-8格式的代码,会同时提示以上内容。从内容推断,应当是某个程序在打开文件时,对文件的编码进行了调整。导致问题发生。

【环境】

系统:Windows 10
开发环境:Visual Studio 2022

【解决思路】

找到有可能修改文件编码格式的可能性。包括VS自带的插件,工具。或者是系统的某些设定。
在控制面板中,有一个"使用Unicode UTF-8提供全球语言支持"。当文本未指定编码格式时,将默认作为UTF-8编码进行处理。这样会导致GB2312编码格式的文件被当做UTF-8进行解析。遇到无法解析的字符,将会报错。

【解决方案】

  1. 打开"控制面板"
  2. 选择"时钟与区域"
  3. 选择"区域",切换到"管理"Tab
  4. 点击"更改系统区域设置"
  5. 取消"Beta版:使用Unicode UTF-8提供全球语言支持"
  6. 重启电脑。
    设置图解

标签:GiraKoo,UTF,Some,bytes,VS,Unicode,substitution,character
From: https://www.cnblogs.com/girakoo/p/17511637.html

相关文章

  • ERROR 1153 (08S01): Got a packet bigger than 'max_allowed_packet' bytes
    今天在批量伪造测试数据时,MySQL收到下面异常:ERROR1153(08S01):Gotapacketbiggerthan'max_allowed_packet'bytes。这是因为没有调整mysql的默认配置,默认最大只能处理16M的文件,而我要导入的伪造数据有50M的一个SQL。于是调整配置文件:/etc/my.cnf修改mysql的最大允许包大小......
  • error: failed to push some refs to如何解决
    解决办法方法一对于error:failedtopushsomerefsto‘远程仓库地址’1使用如下命令gitpull--rebaseoriginmaster2然后再进行上传:gitpush-uoriginmaster......
  • Some useful links about pulsar timing and search.
    1,Hintsformigratingfromtempo1totempo2[https://www.astro.ubc.ca/people/stairs/tempo2.html]2,TempoReferenceManual[http://nanograv.github.io/tempo/reference_manual.html]3,Pulsarclockcorrections[https://ipta.github.io/pulsar-clock-corrections/]......
  • Some demos of supervisor conf
    conffilesin/etc/supervisor/conf.d/VersionSupervisorisinstalledbyapt,andit'sversionis:sudosupervisord--version4.1.0ConffilesThereareDjangoprojects,FastAPIprojects,CelerybeatandworkerinthecloudserverDjangoProject......
  • 【GiraKoo】adb.exe频繁崩溃,与Android设备连接不稳定
    【解决方案】adb.exe频繁崩溃,与Android设备连接不稳定在使用AndroidStudio时,发现adb.exe连接非常不稳定。通过EveryThing工具搜索关键字adb.exe。发现了大量的AppCrash_adb文件夹,adb.exe.xxx.dmp文件等情况。初步判断,应当是adb在运行时,程序频繁崩溃。遇到此类问题,尝试了以下几......
  • 【Exception】The dependencies of some of the beans in the application context fo
    案发现场***************************APPLICATIONFAILEDTOSTART***************************Description:Thedependenciesofsomeofthebeansintheapplicationcontextformacycle:┌─────┐|asyncConfigdefinedinfile[E:\code\spring-boot-demo\t......
  • Golang标准库之bytes介绍
    本次主要介绍golang中的标准库bytes,基本上参考了字节|bytes、Golang标准库——bytes文章。bytes库主要包含5大部分,即:常量变量函数BufferReader我们依次学习上面的5大部分。1、常量constMinRead=512bytes.MinRead是一个常量,表示在使用ReadFrom方法从i......
  • [转]XMPP协议之Socket5 Bytestream文件传输
    [b]XMPP协议之Socket5Bytestream文件传输[/b]SOCK5流协商的建立一部分通过XMPPXML流,一部分通过一个独立的socket实际的文件传输发生在创建的socket上。第一步:[发送端]发送SI(流协商)包AA:<iqtype='set'id='gaim8215f9ef'[email=to=]to='[email protected]/......
  • Qt第六十二章:图标库QtAwesome的使用
    目录一、安装依赖二、主页三、文档四、案例1、图标2、样式3、alpha通道4、多图标堆叠5、动画6、字体五、系列1、msc系列2、fa5系列(选择free栏)3、fa5s系列(选择free栏)4、fa5b系列(选择free栏)5、fa系列6、ei系列7、mdi系列8、mdi6系列9、ph系列10、ri系列一、安装依赖pipinstallQtA......
  • Font-AweSome在Vue中的使用
    Font-AweSome在Vue中的使用yarnaddfont-awesome或者npmifont-awesome-S在main.js中引入import'font-awesome/css/font-awesome.min.css'Vue中使用<iclass="fafa-camera-retro"></i> ......