fix string encoding issue to work with ruby1.9