Fix Encoding::UndefinedConversionError

I ran into this issue when using the gem in our Rails 4 app. I found the solution in issue #6 but it has not been fixed yet. I wasn't exactly sure how to test this, so unless anyone provides any additional assistance, this is the best I can do.