Ruby 对字符串进行转码

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

require 'iconv'
input_encoding = "windows-1252"
output_encoding = 'utf-8'

converted_doc = Iconv.new(output_encoding, input_encoding).iconv("asdf")