Encode string from specified encoding to UTF-8 using Ruby1.8 (#467)

But I cannot run spec using Ruby1.8.7 because some gems don't support
Ruby1.8.7 anymore.