Home > Java > JavaBase > body text

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

王林
Release: 2019-11-12 14:04:44
Original
3149 people have browsed it

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

Run the following command:

vi /etc/profile
Copy after login

Add the following two lines of configuration:

export LC_ALL="zh_CN.GBK"
export LANG="zh_CN.GBK"   
(export.GB18030)
Copy after login

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

source /etc/profile
Copy after login

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!

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