From: Wayne Brissette Date: 2011-09-15T18:50:29+09:00 Subject: gsub in 1.9 vs. 1.8 First off, I'm very new to Ruby and I'm trying to wrap my head around a few things, so if this sounds simplistic I apologize in advance… I did do some searching but I'm not sure how to fix this error. I'm using Mac OS X (Lion) and I've started a script that reads in an xml file (ditamap) and parses the data, so I only end up with a listing of files that map uses. When I run the script using Ruby 1.8.x, the script works as I expected it to work. However, when I run it using Ruby 1.9.x, I get the following error: `gsub': invalid byte sequence in US-ASCII (ArgumentError) From what I've determined via the web, this has to do with some mis-match of what the OS is using vs. what Ruby is using. One post I read recommended reading the file as a binary to get around this. However, I'm wondering what the real fix is for this problem, and why is it happening in 1.9 vs. 1.8. For the record, here is how I'm opening my files: ditamap_file= File.read("v5630097.ditamap") Thanks, Wayne