Linux Learning seven-garbled solution

Source: Internet
Author: User

First, the reason for garbled characters

Garbled code is caused by a non-uniform, there are some places to pay attention to

1. Linux system default supported language data: This is related to/etc/sysconfig/i18n;
2. Your terminal interface (BASH) language: This is related to LANG's variable;
3. The original encoding of your file; Use the file command to view
4. The software that opens the terminal, such as the window interface under GNOME.

Second, DOS and UNIX under the conversion of documents

Dos and UNIX under the different definition of line, DOS is \ r \ n, Unix is \ n

Dos2unix [-kn] file [NewFile]

Unix2dos [-kn] file [NewFile]

Options and Parameters:

-K: Retains the original mtime time format of the file (does not update the file last modified time)

-N: Preserves the original old file, outputs the converted content to the new file,

Third, the Code conversion

Iconv--list

Iconv-f Original code-t new code filename [-o newfile]

Options and Parameters:

--list: List of language data supported by Iconv

-f:from, the original encoding format;

-t:to, new encoding format;

-O File: If you want to keep the original file, use the-o new file name to create a new encoded file.

Linux Learning seven-garbled solution

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.