Linux之iconv转换文本格式的问题

您所在的位置:网站首页 佳能高端相机多少钱一部 Linux之iconv转换文本格式的问题

Linux之iconv转换文本格式的问题

2024-06-17 00:31| 来源: 网络整理| 查看: 265

在Linux上遇到了文本格式的问题:ISO-8859 text 出现了乱码,需要转换格式到UTF-8

[lf_bde@DSJ-NLKF-96 ks2016]$ file dwa_v_m_guoan_comp_011_201608.txt dwa_v_m_guoan_comp_011_201608.txt: ISO-8859 text

iconv的用法是:

iconv -f from-encoding -t to-encoding inputfile -o outputfile

于是按照自己的想法 是把ISO-8859 text 转换到 UTF-8格式 于是:

iconv -f ISO-8859 -t UTF-8 dwa_v_m_guoan_comp_011_201608.txt1 -o dwa_v_m_guoan_comp_011_20160801.txt

但是,并没有成功,出现了错误:

iconv: conversion to `ISO-8859' is not supported Try `iconv --help' or `iconv --usage' for more information.

于是,换了一下写法;

iconv -f gbk -t UTF-8 dwa_v_m_guoan_comp_011_201608.txt -o dwa_v_m_guoan_comp_011_201608.txt

查看文件,成功了;

[lf_bde@DSJ-NLKF-96 ks2016]$ file dwa_v_m_guoan_comp_011_201608.txt dwa_v_m_guoan_comp_011_201608.txt: UTF-8 Unicode text


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3