Fix encoding issue in Ruby 1.9.x