When cmd (command prompt) compiles java files, it prompts the solution to unmappable characters in GBK encoding

After writing a java file using software such as idea, or when the encoding format of cmd is wrong, a compilation prompt will appear showing unmappable characters encoding GBK. This is essentially caused by a coding error. I searched online and found nothing. The solution, I found this simple solution when I was exploring, and I would like to share it with you here.

Go directly to the tutorial below:

1. Open the java file to be compiled with Notepad

2. Click File in the upper left corner and select Save As

3. Change the encoding below from UTF-8 to ANSI, and then save it.

 The error disappears after compiling again.

Please give it a like if it is useful, your support is my biggest motivation!

o(*▽*)q

 

Guess you like

Origin blog.csdn.net/hy123154/article/details/124415092