Home > Article > Operation and Maintenance > Solution to garbled code in linux was
linux was garbled?
The applications deployed on Linux sometimes have garbled characters. You can try to install Chinese fonts to solve the problem.
Recommended: "Linux Tutorial 》
Specific method:
1. You can see many fonts in $JAVA_HOME/jre/lib/fonts/ of java , (if it is websphere, it has its own jvm), create a new directory here, named fallback, and put simsun.ttf into the directory
#mkdir fallback #sudo cp ./your font dir/simsun.ttf fallback/
2. Give the font file permissions as readable
#cd fallback/ #sudo chmod 644 simsun.ttf
3. Then execute in the fallback directory:
#mkfontscale && mkfontdir
At this time, the fonts.dir and fonts.scale files will be generated in the fallback directory, and then the contents of fonts.scale will be appended to the parent directory. fonts.dir,
#su #cat fonts.scale >> ../fonts.dir
4. If it still doesn’t work, refresh the font cache with fc-cache
#fc-cache
simsun.ttf can be downloaded online
The above is the detailed content of Solution to garbled code in linux was. For more information, please follow other related articles on the PHP Chinese website!