记录一下!!!!!!!!!!!!!!!!!

Android Studio java文件突然乱码 File was loaded in the wrong encoding: 'UTF-8'

突然就出现这种情况,项目倒是能够正常运行,但这个锅来的真是莫名其妙!!! 上网查了几种解决方式,只有一种可以解决(因个人情况而定),在此总结一下。

1. File ——> Invalidate Caches /Restart… ——> 点击Invalidate and Restart 然后Studio自动重启。(无效)

2. Build ——> Clean Project 啊!清缓存!!!(无效)

3. 使用Notepad++(没有的自己下一个),调整一下编码方式,然后找个空白的地方敲几个空格,保存之后就好了

(沃特玛!!!!这是个什么鬼情况?????敲几个空格好了?????这个问题的出现和解决方式都是什么鬼????莫名其妙!!!!!!!!!)

第一种解决方式

Android Studio java文件突然乱码 File was loaded in the wrong encoding: 'UTF-8'Android Studio java文件突然乱码 File was loaded in the wrong encoding: 'UTF-8'

第二种解决方式

Android Studio java文件突然乱码 File was loaded in the wrong encoding: 'UTF-8'

第三种解决方式

选择编码方式

Android Studio java文件突然乱码 File was loaded in the wrong encoding: 'UTF-8'
Android Studio java文件突然乱码 File was loaded in the wrong encoding: 'UTF-8'

然后找个地方随便敲空格,接着保存!!!!!!!!!!!

Android Studio java文件突然乱码 File was loaded in the wrong encoding: 'UTF-8'

然后就好了!!!!!!!!!!黑人问号脸!!!什么鬼解决方式????

Android Studio java文件突然乱码 File was loaded in the wrong encoding: 'UTF-8'

参考:File was loaded in the wrong encoding :‘UTF-8’,某一次用Android studio打开旧项目时候java文件显示成乱七八糟的xml语言

相关文章:

  • 2022-12-23
  • 2021-11-15
  • 2021-10-24
  • 2021-05-22
  • 2021-07-16
  • 2022-12-23
  • 2021-07-17
猜你喜欢
  • 2021-04-26
  • 2021-11-26
  • 2021-10-15
  • 2021-12-12
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案