Preserve encoding when on ruby >= 1.9