Centos language problems

Source: Internet
Author: User
Centos 5 Chinese Language Pack Linux view Chinese support commands centos Chinese Language Pack Installation configuration system default encoding Linux piconv file gb2312 to UTF-8

Turn: http://hi.baidu.com/visual_art/item/f8c7dde0993dcbf32a09a4f3

Install all Chinese Fonts

Yum install fonts-Chinese

Install Chinese support

Yum install fonts-IOS885Array

View Chinese support information

Locale


As long as it is UTF-8 encoding on the right.


Display result

Lang = zh_CN.UTF-8

Lc_ctype = "zh_CN.UTF-8"

Lc_numeric = "zh_CN.UTF-8"

Lc_time = "zh_CN.UTF-8"

Lc_collate = "zh_CN.UTF-8"

Lc_monetary = "zh_CN.UTF-8"

Lc_messages = "zh_CN.UTF-8"

Lc_paper = "zh_CN.UTF-8"

Lc_name = "zh_CN.UTF-8"

Lc_address = "zh_CN.UTF-8"

Lc_telephone = "zh_CN.UTF-8"

Lc_measurement = "zh_CN.UTF-8"

Lc_identification = "zh_CN.UTF-8"

Lc_all =



If you do not select Chinese when installing centos, you can install the Chinese language support in the following ways.
# Yum install "@ Chinese support"
You can also useYum grouplistTo list all groups and ages



Chinese support

View #Echo $ Lang

General Chinese system should be zh_CN.utf-8, if the English version of the installation and the installation of the Chinese support package is the en_US.UTF-8 to modify the/etc/sysconfig/language file, rc_lang, rc_lc_all to zh_cn.gb2312, set root_uses_lang to "yes"

The following content is displayed in the English version of the default installation.

# Cat/etc/sysconfig/i18n

Lang = "en_US.UTF-8"

Sysfont = "latarcyrheb-sun16"




Linux piconv file gb2312 convert UTF-8

Use iconv. If not, use piconv. Usage

Iconv-F "GBK"-T "UTF-8" <infile> OUTFILE

Piconv-F "GBK"-T "UTF-8" <infile> OUTFILE

If there are too many files, write a bash script and put it in the directory to convert the encoding.

Script.

#! /Bin/bash

Iconv = iconv

If! Which $ iconv &>/dev/null

Then

Iconv = piconv

Fi

For I in * Action. cpp

Do

$ Iconv-F "GBK"-T "UTF-8" <"$ I"> "$ I. utf8"

Ret = $?

If [$ ret-EQ 0]; then

MV-F "$ I" "$ I. Backup"

MV-F "$ I. utf8" "$ I"

Else

Echo "fail to convert $ I from GBK to UTF-8"

Fi

Done

Exit $ RET

# End

This script will convert your original GBK encoding file to a new utf8 file, and the original file will be renamed to * Action. cpp. Backup, not tested,

Some content comes from the network

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.