win 的文件在 mac 中文乱码的解决办法

win 的文件在 mac 中文乱码的解决办法

iconv 命令

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Usage: iconv [OPTION...] [-f ENCODING] [-t ENCODING] [INPUTFILE...]
or: iconv -l

Converts text from one encoding to another encoding.

Options controlling the input and output format:
-f ENCODING, --from-code=ENCODING
the encoding of the input
-t ENCODING, --to-code=ENCODING
the encoding of the output

Options controlling conversion problems:
-c discard unconvertible characters
--unicode-subst=FORMATSTRING
substitution for unconvertible Unicode characters
--byte-subst=FORMATSTRING substitution for unconvertible bytes
--widechar-subst=FORMATSTRING
substitution for unconvertible wide characters

Options controlling error output:
-s, --silent suppress error messages about conversion problems

Informative output:
-l, --list list the supported encodings
--help display this help and exit
--version output version information and exit

Report bugs to <bug-gnu-libiconv@gnu.org>.

编码转换,显示在终端

iconv -f gbk -t utf8 文件名

编码转换,另存为新文件(UTF8格式)

iconv -f gbk -t utf8 文件名 > 新文件(utf8格式)

# macOS

Comments

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×