1.iconv命令的用法。
Usage: iconv [--binary] [-c] [-s] [-f fromcode] [-t tocode] [file ...]
or: iconv -l
2。使用iconv -l 列出所有的编码
3。使用iconv, 下面是把iso8859-1编码转换到GBK编码的例子
require 'iconv'
conv = Iconv.new("GBK", "ISO-8859-1")
result = conv.iconv("hello")
result << conv.iconv(nil)
conv.close
Usage: iconv [--binary] [-c] [-s] [-f fromcode] [-t tocode] [file ...]
or: iconv -l
2。使用iconv -l 列出所有的编码
3。使用iconv, 下面是把iso8859-1编码转换到GBK编码的例子




