So I am trying to download a zip file from a website and put that data into a table. The download has been working before, but suddenly, it's not anymore. I get a "`write': "\xB6" from ASCII-8BIT to UTF-8 (Encoding::UndefinedConversionError)" problem. Very strange, nothing has changed since i last ran the script. Here is the part of the code that is having the problems. I am using a gem which allows me to parse the DBF file within the zip file.
Here's the code:
`write': "\xB6" from ASCII-8BIT to UTF-8 (Encoding::UndefinedConversionError)
Thanks for the help
UPDATE: I'm running within rails, obviously. I ran the script outside the rails environment, and it worked fine. So Rails is interfering somehow with the write process.
UPDATE 2: SOLVED - I changed "w" to "wb" apparently this is caused by rails 3+. Didn't occur to me to try this before. Hopefully this helps other people.