<title>Linux and Windows file garbled problems</title> Linux and Windows file garbled problems table of Contents
- 1. Introduction
- 2. Iconv detailed
- 2.1. Iconv–help View Help
- 2.2. Example 1
- 3. Dos2unix detailed
- 3.1. Dos2unix–help View Help
- 3.2. Example 1
1Brief introduction
Because the Windows system is the current mainstream, for those of us who work under Linux is a bit unfriendly,
Why are you talking like that? Because we often contact Windows under the file, due to the format of the problem will appear garbled Chinese characters!
Fortunately, Linux offers us the command to solve this problem!
2Iconv detailed2.1Iconv–help View Help
Usage: iconv [Options ...] [File ...]
Converts the encoding of a given file.
Input/output format specification:
-f,–from-code= Name Raw text encoding
-t,–to-code= Name Output encoding
Information:
-l,–list enumeration of all known character sets
Output control:
-C ignores invalid characters from output
-o,–output=file output file-s,–silent close warning
–verbose Printing Progress Information
-?, help gives the system Help list
–usage gives a brief usage information
-v,–version Print Program version number
Mandatory or optional parameters for long options are also mandatory or optional for the corresponding short options.
2.2Example 1
Convert demo.c files in GBK format to demoout.c formatted as UTF-8
Iconv-f gbk-t UTF-8 Demo.c-o demo_out.c
3Dos2unix detailed3.1Dos2unix–help View Help3.2Example 1
Files in Linux that convert DOS format to UNIX format can use Dos2unix if a folder has multiple
Files need to be converted using the following command
Find-type F|xargs Dos2unix--dos2unix--safe or Find-type F|xargs dos2unix-o
Author: Wild Book
CREATED:2016-05-11 three 12:55
Emacs 24.5.1 (ORG mode 8.2.10)
Linux and Windows file garbled problems