Encoding language conversion and line break conversion

Source: Internet
Author: User

1 , encoding Language conversion

Common Chinese language coding language hasgb2312,Big5,UTF8, sometimes a file is converted between different coding languages for some purpose ,Iconvcommand.

$ iconv-l

- L lists the supported encoding languages.

$ iconv-f encoding-t encoding filename [-o file]

-f represents the original encoding format, -t represents the destination encoding format, -o stdout to file.

and a good command. file , you can view the file encoding format and line break characters.

$ file filename

2 , line break conversion

Windowswith theLinuxdifferent line breaks, the former is^m$, i.e.CRLF, the latter is$, i.e.LF, both can be orderedUnix2dosorDos2unixconvert each other.

$ Unix2dos File

$ Dos2unix File

The newline character of the file can be viewed by the following command:

$ cat-a File


Encoding language conversion and line break conversion

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.