linux命令行轉文件編碼

 iconv命令

— 功能說明:將文件從一種編碼轉換成另一種編碼。
 
— 命令格式:iconv [參數] <輸入文件>
 
— 常用參數:
 
?  -f <encoding> : 指定原始文本編碼。
 
?  -t <encoding> : 指定要轉換的編碼。
 
?  -l : 列出所有已知編碼字符集。
 
?  -c : 忽略輸出中的無效字符。
 
?  -o <output file> : 指定輸出文件,而不是在標準輸出上顯示。
 
— 使用示例:
 
 $ iconv -l
 
 $ iconv -f ISO-8859-1 -t UTF-8 -o outputfile inputfile
 
 $ iconv -f GB2312 -t UTF-8 -o outputfile inputfile
 
 $ iconv -f GBK -t UTF-8 -o outputfile inputfile
 
 $ iconv -f BIG5 -t UTF-8 -o outputfile inputfile
 
 $ iconv -f UTF-8 -t GB2312 -o outputfile inputfile 
 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章