Fixed error incompatible character encodings: UTF-8 and ASCII-8BIT

Fixed issue #440 for Ruby version 1.9.3+