iconv --help
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 utf-8 -t gb2312 -c a.txt > c.txt
转换成功的文件,在terminal中用 open . 命令打开当前文件夹,将转换的c.txt扔到浏览器上,查看转换编码结果。
本站仅用于个人学习的笔记和记录,有时候是阅读别人的文章的时候做着笔记整理,有些是在实际工作中遇到的问题以及解决小问题的记录。
当前仅用于作为一个萌新程序媛的查漏补缺地检索地。
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步