日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > linux >内容正文

linux

iconv linux window to mac,iconv - Mac OS 文本格式转换工具

發布時間:2024/3/26 linux 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 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 文本格式转换工具的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。