ruby 1.8 fix for ending string char