Fixing 'invalide byte sequence in UTF-8' error in ruby 1.9