Check Chinese file garbled characters in Windows in Ubuntu

Source: Internet
Author: User

Method 1: Add encoding support

(1) by default, no editor option is configured in the applications menu of ubuntu,

First, add system-> preferences-> main menu-> system tools, and select the configuration editor.

(2) This is an application.ProgramThe configuration editor is available in the menu.

Apps -- gedit-2 -- preferences -- encodings.
Double-click "auto_detected" on the right and click "add". Then, enter "gb18030" and click "OK.

And up to the first item.

Method 2 compile scripts

1 #! /Bin/bash
2 3 The script is used to change a DOS text file
4 to a Unix File
5 help
6
7 e_badargs = 65
8 if [-z "$1"]; then
9 echo "Usage: 'basename $0 'must have one or two arguments"
10 Exit $ e_badargs
11 fi
12
13 if [-z "$2"]; then
14 newfilename = $1. UNIX
15 else
16 newfilename = $2
17 fi
18
19 iconv-f gbk-T UTF-8 $1> $ newfilename # GBK, gb2312, gb18030 Character Set
20
21 echo "Convert complete! "
22 exit 0
~

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.