How to use csv to open file in gbk code

there is an file(/home/pt/test/shbase.csv) in gbk not utf-8,the
following is my progrmm:
require ‘csv’’/home/pt/test/shbase.csv’, ‘r’) do |row|
while line=row.gets
puts line
wrong message:
/usr/local/ruby/lib/ruby/1.9.1/csv.rb:1988:in `=~’: invalid byte
sequence in UTF-8 (ArgumentError)
how to open it use csv?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs