我有一些法语代码点,我想在 Linux 系统上将其解码为 utf-8。
我的文件的内容是(小例子):
Lemari%C3%A9%20
解码后应该是:Lemarié
我读到 iconv 是实现此目的的好工具,但我不知道我应该将什么用作 -f
参数,因为文件内容已编码,所以我只尝试使用 -t
选项没有成功:
iconv -t UTF8 测试.csv
有什么建议吗?
最佳答案
在手册页中,以下是将输入从 ISO88592 编码格式转换为 UTF8 编码格式的命令。输出将是 output.txt 文件。
iconv -f ISO88592 -t UTF8 < input.txt > output.txt
因此在您的情况下,-f
应该与输入文件的编码格式一起使用。喜欢
iconv -f <input file encoding format> -t UTF8 < test.csv > output.txt
关于linux - 问题 : Decoding a file on linux machine from command line,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27123771/