Home  >  Article  >  Java  >  Solution to garbled characters when reading Chinese files in Java under Linux

Solution to garbled characters when reading Chinese files in Java under Linux

王林
王林Original
2019-11-12 14:04:443081browse

Solution to garbled characters when reading Chinese files in Java under Linux

Run the following command:

vi /etc/profile

Add the following two lines of configuration:

export LC_ALL="zh_CN.GBK"
export LANG="zh_CN.GBK"   
(export.GB18030)

After saving successfully, enter the following command to reload the configuration:

source /etc/profile

Finally restart the java project.

Recommended tutorial: Java tutorial

The above is the detailed content of Solution to garbled characters when reading Chinese files in Java under Linux. 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