位置处的非法输入序列:使用unix将文件从Big5转换为UTF8

时间:2018-02-22 10:16:58

标签: unix encoding utf-8 decoding apache-nifi

我尝试使用iconv命令将文件从Big5转换为UTF8。我收到错误:illegal input sequence at position 18876

iconv -f BIG5 -t UTF8 doc_full_list.csv > doc_full_list.csv.out

当我使用Apache Nifi“ConvertCharacterSet”处理器时,它可以成功转换同一个文件。

它基本上修复了以下错误:

final CharsetDecoder decoder = inputCharset.newDecoder();
        decoder.onMalformedInput(CodingErrorAction.REPLACE);
        decoder.onUnmappableCharacter(CodingErrorAction.REPLACE);
        decoder.replaceWith("?");

是否可以在不使用任何工具的情况下从unix命令行实现转换?

0 个答案:

没有答案