I’ve looked all over the internet and can’t seem to figure out what I
need to do to get past this error. I admit, I’ve only been playing with
Ruby for a couple of days so bear with me.
I created a script to read the info and first post from a list of forum
threads. I can get all of the data in arrays and export to a CSV
perfectly fine with small batches. However, I know the forum has some
japanese and other language posts and I can only assume one of those is
what’s causing this problem.
After the parsing of my list of HTML pages is done and it starts writing
the data to CSV, about half way I get this:
join': incompatible character encodings: UTF-8 and ISO-8859-1 (Encoding::CompatibilityError) from F:/ruby/lib/ruby/1.9.1/csv.rb:1729:in<<’
block (2 levels) in <main>' from threads.rb:80:ineach’
block in <main>' from F:/OfflineExplorerPortable/ruby/lib/ruby/1.9.1/csv.rb:1354:inopen’
from threads.rb:77:in `’
I tried a dozen different things I read online about encoding to try and
fix it but they either didn’t do anything or threw me other method
errors. It’s probably simple but it’s beyond me at the moment. Can
anyone give the FNG a little help? I’d appreciate it!