iconv linux window to mac,iconv - Mac OS 文本格式转换工具
1. iconv 介紹
iconv命令可以將一種已知的字符集文件轉換成另一種已知的字符集文件。
它的作用是在多種國際編碼格式之間進行文本內碼的轉換。
iconv基于GPL公開源代碼,是GNU項目的一部分。在各種UNIX操作系統下均可使用,而在Windows系統,需要特殊的環境如cygwin或者GnuWin32等軟件平臺下方可使用。
iconv 幫助文檔如下:
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
2. iconv文本格式轉換 - utf8轉gbk的方法
在 bash 環境行運行如下指令
iconv -f UTF-8 -t GBK test_utf8.txt > test_gbk.txt
3. 查看文本編碼格式
在vim中可以直接查看文件編碼
:set fileencoding
即可顯示文件編碼格式。
4. vim文本格式轉換 - utf8轉gbk
在Vim中直接進行轉換文件編碼,比如將一個文件轉換成utf-8格式
:set fileencoding=utf-8
5. mac下二進制文件查看
vi -b 打開目標文件,并在命令模式下,輸入如下指令
:%!xxd
總結
以上是生活随笔為你收集整理的iconv linux window to mac,iconv - Mac OS 文本格式转换工具的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 动态网站的制作与设计_动态网站制作是什么
- 下一篇: 2021年全球人工智能物流无人机行业调研