Maybe you should not encode the data from its external_encoding to
UTF-8.
I had been trapped in the encoding problem that some GBK characters
cannot transform to UTF-8.

# encoding: utf-8
File.open('file.txt', 'r:gbk').each_line do |line| # not 'r:gbk:utf-8'
  arr = line.chomp.split("\t".encode('gbk')) # encode "\t" to gbk
  # blah blah
end

Joey

-- 
Posted via http://www.ruby-forum.com/.