Solutions for displaying Chinese file names and folders as blocks and garbled characters after Debian system installation

Source: Internet
Author: User
When installing the debian system, if you choose to use Chinese characters as the font of the operating system, but are not synchronized during the installation process, it is likely that after the debian system is installed successfully, all Chinese characters will contain small numbers and black question marks (as shown in the first figure ). This is because the system is installed

When installing the debian system, if you choose to use Chinese characters as the font of the operating system, but are not synchronized during the installation process, after the debian system is successfully installedSmall square numbers and black block question marks(As shown in the first figure ). The reason for this is that the Chinese character Library is not installed during system installation. I searched for some online solutions as follows:

Use the apt-get install ttf-arphic-uming xfonts-intl-chinese or apt-getinstallttf-wqy-microhei command to obtain and install the pack. However, I cannot use this method. I can't find the software package, but I can't find it from the installation disk. I have configured the debian network so that it can access the Internet, and then modified/etc/apt/sources. the list file still cannot be searched from the internet, so the method is abandoned.

The debian system displays square numbers, letters, and black question marks in Chinese.

After searching, you can find a simple and effective method to directly copy the simplified Chinese font file of windows to the debian font directory. the specific operation is as follows:

Find simsun from the font directory of windows. the ttc file is connected to the debian system through the WinSCP tool, and the file is transferred to the/usr/share/fonts/truetype directory in the system. Be sure to perform this operation, the current user must have the administrator permission; otherwise, the replication will fail.

Then go to the debian system, run the dpkg-reconfigurelocales command as administrator to set the system font, select the zh_con.UTF-8 area settings and have them generate in the system.

Then set the default font to zh_con.UTF-8.

Finally, restart the debian system and select the language to be used in the logon interface as Chinese.

After entering the system, the Chinese font is displayed.

The area setting box is not garbled.

After the above processing, the debian system can correctly display Chinese characters. However, for the debian terminal console, garbled characters are still displayed when encountering Chinese characters, you can use the following methods (from the Internet ).

Debian Chinese settings

Solving Chinese garbled characters and squares in Debian character terminals is the first tricky problem after I first installed debian. The final conclusion is: currently, Debian cannot solve this problem, and the zhcon tool must be installed to solve it.

Configure Local

Aptitude install locales
Dpkg-reconfigure locales

Jump out of a text selection interface (if you select Chinese during installation, the text is garbled), page up/dn flip page, space key select the following encoding

En_US.UTF-8 UTF-8
Zh_CN.GBK GBK
Zh_CN.GB2312
Zh_CN.UTF-8 UTF-8

Then Tab? Switch to OK, and finally select en_US.UTF-8 by default language
Edit the locale file and check whether lang is set to en_US.UTF-8. if not, modify.

Vim/etc/default/locale

About Local default language selection

It is recommended that the Local default language select en_US.UTF-8,

Select the character terminal for the zh_CN.UTF-8, a Chinese prompt for the square (http://www.debianedu.org/shells/tools/zhcon) appears ).
Select en_US.UTF-8 so character terminal, full English prompt.
Select the en_US.UTF-8 so Gnome is also English after it is started (Note: Starting gnome in zhcon is Chinese ).

Install and configure zhcon

Currently, Debian cannot display Chinese characters in character terminals. Therefore, you must install the zhcon tool. For details, see zhcon, the Chinese character display input tool for character terminals.

Aptitude install zhcon # installation
Zhcon? Utf8? Drv = vga # Start (ctrl + d exit)
Vim/root/. 'Bash' rc
Add alias zhcon = 'zhcon? Utf8? Drv = vga'

Special reminder! Enter zhcon must be root, or sudo get permissions, otherwise enter zhcon is a Chinese garbled prompt, even if the local is set to en_US.UTF-8.

Open the truetype folder under the fonts directory in Ubuntu, create a new folder, name it Windows-Fonts (name casually), and copy the font in. Of course, you can also Link the Windows font of the dual system.

Refresh the font cache. the command is as follows,

# Sudo mkfontscale

# Sudo mkfontdir

# Sudo fc-cache-fv

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.