When running the script with Ruby 1.9, change the first two lines of the script to:
require 'net/http'
This tells Ruby to run a character set script UTF-8. Without this line, Ruby 1.9 will have a character set by default US_ASCII.
: Ruby 1.8, 1.8 . Ruby 2.0, Ruby 2.0 UTF-8.