iconv 轉換為 utf-16 而非 utf-8

iconv 轉換為 utf-16 而非 utf-8

我有一個 ISO-8859 文件,需要將其轉換為 UTF-8:

file *
test.csv: ISO-8859 text, with very long lines, with CRLF line terminators

現在我在 Windows 上使用 iconv.exe,如下所示:

iconv.exe -f iso-8859-1 -t utf-8//TRANSLIT test.csv > conv.csv

問題是現在我看到奇怪的字符,其中出現拉丁字符(例如à,ì,...),並且通過檢查似乎它已轉換為UTF-16!

file *
test.csv: ISO-8859 text, with very long lines, with CRLF line terminators
conv.csv:                        Little-endian UTF-16 Unicode text, with very long lines, with CRLF, CR line terminators

這是為什麼?我怎樣才能完成簡單的UTF-8?

相關內容