Fixes for Ruby 1.8.7

`force_encoding` doesn't do anything in Ruby 1.8.7, but it doesn't have
string encodings anyway so the issue doesn't manifest.