【发布时间】:2018-01-09 22:27:21
【问题描述】:
每次我遇到 Unicode 时,都没有任何作用。我在 Linux 上,我从 Windows 获得了这些文件:
$file *
file1: UTF-8 Unicode text
file2: ISO-8859 text
file3: ISO-8859 text
在我发现文件有不同的编码之前,什么都没有。我想让我的生活变得轻松,并让它们都采用相同的格式:
iconv -f UTF-8 -t ISO-8859 file1 > test
iconv: conversion to `ISO-8859' is not supported
Try `iconv --help' or `iconv --usage' for more information.
我尝试转换为 ISO,因为这只是 1 次转换 + 当我在 gedit 中打开这些 ISO 文件时,德语字母“ü”显示得很好。好的,下次试试:
iconv -f ISO-8859 -t UTF-8 file2 > test
iconv: conversion from `ISO-8859' is not supported
Try `iconv --help' or `iconv --usage' for more information.
但显然这不起作用。
【问题讨论】:
-
那是因为“ISO-8859”不是编码。您的意思是 ISO-8859-1 还是 ISO-8859-15?还是one of the other 14?
-
您的 utf-8 源文件也可能有问题。它可以包含在 ISO-8859 中无法表示的字符。转换成 utf-8 会更安全。