Use enca to convert file character encoding in Ubuntu

Source: Internet
Author: User
1. Ubuntu Installation Method: sudoapt-getinstallenca2. command usage Introduction: 1) return the encoding of the file: enca-Lzh_CN file name returns information such as: Universaltransformationformat8bits; UTF-8Mixedlineterminators or a single sentence Universaltransformationformat8bi

1. Ubuntu installation method:
Sudo apt-get install enca

2. command usage:
1) encoding of the returned file:
Enca-L zh_CN file name
The following information is returned:
Universal transformation format 8 bits; UTF-8
Mixed line terminators
Or a single sentence
Universal transformation format 8 bits; UTF-8

2) convert the character encoding of all files in the current directory to UTF-8 encoding:
Enca-L zh_CN-x UTF-8 *

3) If you do not want to overwrite the original file, you can do this:
Enca-L zh_CN-x UTF-8 original file target file

Note: The UTF-8 is the target encoding,-L represents the language environment,
If some files cannot be converted during the conversion process, enca will list them for you.

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.