Mein System ist SUSE Linux Enterprise Server 11.
Ich versuche, Daten aus dem UTF-8-Format in ein ISO-Format zu konvertieren, das "Iconv" verwendet
$>file test.utf8
test.utf8: UTF-8 Unicode text, with very long lines
$>
$>file -i test.utf8
test.utf8: text/plain charset=utf-8
$>
$>iconv -f UTF-8 -t ISO-8859-1 test.utf8 > test.iso
iconv: test.utf8:20:105: cannot convert
Könnten Sie mir dabei helfen? Danke.
Ihre Eingabedatei enthält Zeichen, die in Latein 1 nicht vorhanden sind. Sie können die -c
-Option verwenden, um sie zu überspringen:
iconv -c -futf8 -tl1 test.utf8 > test.iso
Manchmal ist es am besten, -c und // TRANSLIT zu verwenden, z.
$ cat rodriguez
Rodrı́guez
$ file rodriguez
rodriguez: UTF-8 Unicode text
$ iconv --unicode-subst="<U+%04X>" -f UTF-8 -t ISO-8859-1 rodriguez
Rodr<U+0131><U+0301>guez
$ iconv -f UTF-8 -t ISO-8859-1 rodriguez
Rodr
iconv: rodriguez:1:4: cannot convert
$ iconv -f UTF-8 -t ISO-8859-1//TRANSLIT rodriguez
Rodri
iconv: rodriguez:1:5: cannot convert
$ iconv -c -f UTF-8 -t ISO-8859-1 rodriguez
Rodrguez
$ iconv -c -f UTF-8 -t ISO-8859-1//TRANSLIT rodriguez
Rodriguez
Verwenden Sie den //TRANSLIT
-Parameter und die Dummy-Zeichen werden eingefügt.
iconv -f UTF-8 -t ISO-8859-1//TRANSLIT test.utf8 > test.iso