I have a hash names hsh that has values that are UTF-8 encoided. For example:
hsh ={:name => some_utf_8_string, :text => :some_other_utf_8_string}
I am currently doing the following:
$KCODE="UTF8"
File.open("save.tsv","w") do{|file|
file.puts hsh.values.map{|x| x.to_s.gsub("\t",' ')}.join("\t")
}
But this croaks randomly because I think some of the multibyte contents sort of match "\t" and it fails. Is there a recommended string I can use instead of "\t" and also is there a better way of doing the above?
Thanks