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!