解决IDEA 中配置文件(properties)中文乱码

1. 打开Preferences

  • Mac下快捷键为commond + ,

  • win应该是ctrl+alt+s(好像是这个, 不确定…)

  • 或通过action搜索preferences打开

2. 修改File Encodings配置

注意下图中红色框中的部分, 绿色框根据自己的情况选择是否带BOM

  • Global Encoding : 全局编码
  • Project Encoding : 项目编码
  • Path : 文件路径(一般默认没有resources路径, 要补上)
  • Default encoding for properties files : properties文件默认编码
  • Transparent native-to0ascii conversion : ascii码转化透明化
    • 例如: 将\u8F6C\u5316\u6211 转为 转化我

也有的项目是用GBK编码的, 特别是老项目, 如果UTF-8依旧乱码可以尝试下

解决IDEA 中配置文件(properties)中文乱码

相关文章:

  • 2021-06-17
  • 2021-08-13
  • 2021-12-06
  • 2021-11-04
  • 2021-11-01
  • 2021-12-26
  • 2021-11-21
猜你喜欢
  • 2022-01-07
  • 2021-08-29
  • 2021-08-13
  • 2021-11-21
  • 2021-08-13
  • 2021-08-13
  • 2022-01-03
相关资源
相似解决方案