Home > Java > Javagetting Started > body text

Garbled characters are output in the java output statement

王林
Release: 2019-11-23 16:17:29
Original
4020 people have browsed it

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template