Home  >  Article  >  Java  >  Garbled characters are output in the java output statement

Garbled characters are output in the java output statement

王林
王林Original
2019-11-23 16:17:293776browse

Garbled characters are output in the java output statement

Reason:

My java file is saved in UTF-8 encoding, while javac is compiled in computer system encoding (GBK, I It is handled by win 7 system).

Solution:

Method 1. Store the java file in GBK encoding, then compile and run it;

Method 2 , specify encoding as UTF-8 when compiling, compile command.

Compilation command (the file name depends on the actual situation):

Garbled characters are output in the java output statement

Recommended tutorial: java quick getting Started

The above is the detailed content of Garbled characters are output in the java output statement. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn