ubuntu file encoding

赵丹icons逐LJ 2011-05-24

ubuntu file encoding

sudoapt-getinstallenca

manenca

encagzwfcx.js

enca--listcharsets

enca--listsurfaces

enca--listlanguages

encagzwfcx.js(willconvertfileFILEtoyourlocalenativeencoding.)

Universaltransformationformat8bits;UTF-8

encagzwfcx.js

Universaltransformationformat8bits;UTF-8

enca-xGB2312gzwfcx.js

encagzwfcx.js

SimplifiedChineseNationalStandard;GB2312

enca--listlanguages

russian:KOI8-RCP1251ISO-8859-5IBM866maccyr

chinese:GBKBIG5HZ

建议以后编程序的时候,遇到默认编码为GB2312的大可以直接使用GBK进行解码为unicode字符串。

require'iconv'

Iconv.iconv('utf-8','GBK',text)

Note:编码转换后关闭文件再重新打开

相关推荐