gpt4 book ai didi

linux - 问题 : Decoding a file on linux machine from command line

转载 作者:太空宇宙 更新时间:2023-11-04 11:00:47 26 4
gpt4 key购买 nike

我有一些法语代码点,我想在 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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com