当前位置:网站首页>IDEA file encoding modification
IDEA file encoding modification
2022-08-04 23:50:00 【Cham valley Gooyuit】
Original link: https://blog.csdn.net/cgl125167016/article/details/78666432
IDEA Chinese Tutorial: https://github.com/judasn/IntelliJ-IDEA-Tutorial/
BrotherThank you to these two bloggers~
This article introduces how to modify the file encoding in IntelliJ IDEA, refer to the IntelliJ IDEA Simplified Chinese special tutorial, students who are good in English can view the official English documentation
File encoding modification
IntelliJ IDEA can modify the encoding of the project file under File -> Settings -> Editor -> File Encoding in the menu
Write picture description here
The default global encoding of IDE is UTF-8, and Project Encoding will be GBK of the operating system by default, which is generally modified to UTF-8
IntelliJ IDEA can set special encoding settings for Properties files, and it is also recommended to change toUTF-8, one of the key points is the property Transparent native-to-ascii conversion, which is generally checked, otherwise the comments in the Properties file will not be displayed in Chinese.
IntelliJ IDEA supports setting the encoding for the entire Project.In addition, it also supports encoding settings for directories and files.If you want to set the encoding of the directory, there may be a pop-up operation option that requires Convert encoding. It is strongly recommended to back up the files before conversion, otherwise the conversion process may become garbled and cannot be restored
In addition, the individual files ofThe encoding can also be set like this
Write picture description here
may pop up such a pop-up box
Write picture description here
Reload means to reload with the new code, the new code will not be saved to the file
Convert means to use the new code to convert, the new code will be saved to the file
The code file containing Chinese, Convert 2Xf2E6aEU7n685eHEbXGYHrmWn2y7a62UWBrtZzodVdD
Compilation errors caused by encoding problems
Compilation error: cannot find symbols, unterminated string literals, etc. Solutions:
Because UTF-8 encoded files have BOM and no BOM, the compiler used by IntelliJ IDEA is javac by default, and this compilation can only compile files without BOM. Many Eclipse users are using IntelliJ IDEAThis problem is often encountered when developing Eclipse projects.Mainly because the compiler of Eclipse is Eclipse, which supports the compilation of files with BOM.Therefore, the solution is to perform BOM removal for this file
To remove BOM in batches, you can Google: batch removal of BOM, batch conversion without BOM and other keywords, various solutions have been provided on the Internet
If the above problems cannot be solvedSolved, and you also confirmed that all configuration encodings of IntelliJ IDEA are UTF-8, and the error file encoding is also UTF-8 without BOM, then there is another possibility that this situation will also occur: there is a problem with the project configuration file.The configuration file of project encoding is in: /project directory/.idea/encodings.xml.If you can modify this file, you can modify it. If not, delete the entire .idea directory, restart IntelliJ IDEA, and reconfigure the project.
Tomcat console output garbled characters
IDEA's unified console coding control, find idea.exe.vmoptions in your idea.bin or 64 directory or add -Dconsole.encoding=UTF-8 in 64. Note that it is console reference: https://stackoverflow.com/questions/35231291/intellij-idea-incorrect-encoding-in-console-output
If your Tomcat console outputs garbled characters, and you have ensured that the console font settings in this article contain Chinese, you can also try adding: -Dfile.encoding to the VM parameters of Tomcat=UTF-8, as shown in the figure
Write picture description here
边栏推荐
- 未上市就“一举成名”,空间媲美途昂,安全、舒适一个不落
- Develop a SpaceX website based on the Appian low-code platform
- 直接插入排序
- 矩阵数学原理
- C5750X7R2E105K230KA(电容器)MSP430F5249IRGCR微控制器资料
- 堪称奔驰“理财产品”,空间媲美宝马X5,采用了非常运动的外观
- 10 个关于 Promise 和 setTimeout 知识的面试题,通过图解一次说透彻
- Day118.尚医通:订单列表、详情、支付
- 3. Actual combat---crawl the result page corresponding to Baidu's specified entry (a simple page collector)
- 2022年华数杯数学建模
猜你喜欢

基于深度学习的路面坑洞检测(详细教程)

Pytorch分布式训练/多卡/多GPU训练DDP的torch.distributed.launch和torchrun

KT148A语音芯片怎么烧录语音进入芯片里面通过串口和电脑端的工具

956. 最高的广告牌

生产者消费者问题

Implementing class target method exception using proxy object execution
![[Cultivation of internal skills of string functions] strncpy + strncat + strncmp (2)](/img/9f/9221c081cfa86caccbbd02916a6208.png)
[Cultivation of internal skills of string functions] strncpy + strncat + strncmp (2)

一、爬虫基本概念

【手撕AHB-APB Bridge】~ AMBA总线 之 AHB

3年,从3K涨薪到20k?真是麻雀啄了牛屁股 — 雀食牛逼呀
随机推荐
仿网易云音乐小程序-uniapp
上课笔记(6)(2)——#742. 周末舞会
注解@EnableAutoConfiguration的作用以及如何使用
从单体架构迁移到 CQRS 后,我觉得 DDD 并不可怕
[QNX Hypervisor 2.2用户手册]10.4 vdev hpet
【数据挖掘概论】数据挖掘的简单描述
游戏3D建模入门,有哪些建模软件可以选择?
MVCC是什么
堪称奔驰“理财产品”,空间媲美宝马X5,采用了非常运动的外观
10 个关于 Promise 和 setTimeout 知识的面试题,通过图解一次说透彻
MySQL的安装与卸载
MySQL基础篇【聚合函数】
再肝3天,整理了90个 NumPy 例子,不能不收藏!
头脑风暴:完全背包
Chinese and Japanese color style
OPENCV学习DAY8
4-《PyTorch深度学习实践》-反向传播
2022年华数杯数学建模
web3.js
【LeetCode】滑动窗口题解汇总