avoid encode.b for previous versions of ruby