Encode only for Ruby >= 1.9