文本字符集转换

http://lqqnotes.blog.51cto.com/3329069/659886

拉取数据 在我opensuse下OK 

产品的WIN下面乱码

# enca -L 现在文件的语言 -x 需要转换编码 需要转换编码的文件

查看文件编码
jin@linux-gzy1:~> enca -d Downloads/store_sdb_ectools_regions_0211-3.csv
Downloads/store_sdb_ectools_regions_0211-3.csv: Universal transformation format 8 bits; UTF-8

jin@linux-gzy1:~> file Downloads/store_sdb_ectools_regions_0211-3.csv
Downloads/store_sdb_ectools_regions_0211-3.csv: UTF-8 Unicode text


jin@linux-gzy1:~> enca -L UTF-8 -x GBK Downloads/store_sdb_ectools_regions_0211-3.csv
enca: Cannot determine (or understand) your language preferences.
Please use `-L language', or `-L none' if your language is not supported
(only a few multibyte encodings can be recognized then).
Run `enca --list languages' to get a list of supported languages.
jin@linux-gzy1:~> enca --list languages
belarussian: CP1251 IBM866 ISO-8859-5 KOI8-UNI maccyr IBM855 KOI8-U
bulgarian: CP1251 ISO-8859-5 IBM855 maccyr ECMA-113
czech: ISO-8859-2 CP1250 IBM852 KEYBCS2 macce KOI-8_CS_2 CORK
estonian: ISO-8859-4 CP1257 IBM775 ISO-8859-13 macce baltic
croatian: CP1250 ISO-8859-2 IBM852 macce CORK
hungarian: ISO-8859-2 CP1250 IBM852 macce CORK
lithuanian: CP1257 ISO-8859-4 IBM775 ISO-8859-13 macce baltic
latvian: CP1257 ISO-8859-4 IBM775 ISO-8859-13 macce baltic
polish: ISO-8859-2 CP1250 IBM852 macce ISO-8859-13 ISO-8859-16 baltic CORK
russian: KOI8-R CP1251 ISO-8859-5 IBM866 maccyr
slovak: CP1250 ISO-8859-2 IBM852 KEYBCS2 macce KOI-8_CS_2 CORK
slovene: ISO-8859-2 CP1250 IBM852 macce CORK
ukrainian: CP1251 IBM855 ISO-8859-5 CP1125 KOI8-U maccyr
chinese: GBK BIG5 HZ
none:


jin@linux-gzy1:~> enca -x GBK Downloads/store_sdb_ectools_regions_0211-3.csv
jin@linux-gzy1:~> enca -d Downloads/store_sdb_ectools_regions_0211-3.csv
Downloads/store_sdb_ectools_regions_0211-3.csv: Simplified Chinese National Standard; GB2312

jin@linux-gzy1:~> file Downloads/store_sdb_ectools_regions_0211-3.csv
Downloads/store_sdb_ectools_regions_0211-3.csv: Non-ISO extended-ASCII text

另外kwrite打开另存于也可以转换,KDE GUI下载

你可能感兴趣的:(字符集)