More encoding fixes for old rubies