encoding fix for older Rubies