此内容没有您所选择的语言版本。

Chapter 9. Advanced Topics


9.1. Using the iconv tool

The iconv tool converts the encoding of characters in a file from one coded character set to another. The result is written to standard output unless otherwise specified by the --output option. When doing conversions it is always a good idea to backup ones original files first.
The following are some useful examples of using the iconv tool.
  • List character-set encoding names:
    iconv --list
    Copy to Clipboard Toggle word wrap
  • Convert ISO8859-1 (legacy Western European) content to utf-8
    iconv -f ISO_8859-1 -t UTF-8 oldfile > newfile
    Copy to Clipboard Toggle word wrap
    In the above example, the oldfile is encoded in ISO8859-1, while the "newfile" will be encoded in UTF-8.
  • Similarly to convert EUCJP content to UTF-8
    iconv -f EUCJP -t UTF-8 oldfile > newfile
    Copy to Clipboard Toggle word wrap
See the iconv (1) manpage for more details.
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat