读书人

IConv 的编码 很扭结

发布时间: 2012-12-19 14:13:14 作者: rapoo

IConv 的编码 很纠结
irb>>URI.escape(Iconv.conv("GBK","UTF-8", "The sea of fresh organic pot"))

Iconv::IllegalSequence: "??fresh orga"...
from (irb):17:in `conv'
from (irb):17


----
改进后得知:

irb>>URI.escape(Iconv.conv("GB18030","UTF-8", "The sea of fresh organic pot"))



是字符集的大小问题阿 GBK 和 GB2312 都小于GB18030

读书人网 >编程

热点推荐