About Linux and Windows pass file garbled problem

Source: Internet
Author: User
Tags i18n

Linux is generally encoded with utf-8, and when we edit a file on Windows it is gb2312 encoding. So the Chinese encoding will be garbled. It's really easy to correct the problem by simply converting the file into UTF-8 encoded format and then importing it OK.

To manually change the configuration file command:

vi/etc/sysconfig/i18n

will lang= "ZH_CN. UTF-8 "modified to: lang=" ZH_CN.GBK "

Save and close, and run the following command to make the configuration effective:

source/etc/sysconfig/i18n

Display the terminal character encoding as Simplified Chinese:

vi/etc/profile.d/chinese.sh

Add the following line: Export LC_ALL=ZH_CN. GBK

source/etc/profile.d/chinese.sh

OK, configuration complete, test it!

[[email protected] bin]#VI one.sh## ====================================================#### auth:wonter # ### date:2014-06-12 # ### to:one.sh # ### ====================================================###!/bin/sh#Get server list letter 1m|/./. List.ll#Execute get File script#nameList1= (' Cat.. /tools/list | Awk'{print $}'| Sed"1,1d"`) for((i=0;i<${#list1[@]};i++));Do sh./${list1[i]}.wydoneecho" "Echo"------------------------------------------------------"Echo" "Echo"The first step is completed, please follow the instructions below to modify the relevant configuration file! "Echo" "Echo"#conf"Echo" "Echo"Once you have modified the configuration, go back to this directory and execute the two.sh script. "Echo" "Echo"------------------------------------------------------"

And look at the previous garbled.

## ====================================================#### auth:wonter # ### date:2014-06-12 # ### to:one.sh # ### ====================================================###!/bin/sh#m~n1m~o~vm~\~mm~j1m~y1m~h~w Table Letter M~a/.list.ll#m~i[1m~lm~n1m~o~vm~v~g pieces M~d~zm~\nameList1= (' Cat.. /tools/list | Awk'{print $}'| Sed"1,1d"`) for((i=0;i<${#list1[@]};i++));Do sh./${list1[i]}.wydoneecho" "Echo"------------------------------------------------------"Echo" "Echo"section [email protected] Step m~i[1m~l1m~l1m~u1m~l please m~i[1m~l1m~km~v1m~o~p m~q1m~l repair m~t1m~[1m~e1m~e~m m~v~g parts 1m~a"Echo" "Echo"#conf"Echo" "Echo"Repair M~t1m~[1m~e1m~e~m m~p~n1m~l please m~f~mm~[~^m~h1m~\1m~[[1m~u1m~k1m~lm~i[1m~l two.sh m~d~zm~\"Echo" "Echo"------------------------------------------------------"

Test success, share to everyone! Please pay attention to share ....

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.