Add hack for ruby 1.8 encoding handling