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

你可能感兴趣的:(iconv)