when I try to call .reverse on a Ruby string that contains apostrophes, it changes them to \231\200?. So on a string that is in the wrong order that contains s’tIcalling reverse results in It\231\200?s, not It's. any ideas?
I am guessing this has to do with multi-byte safety? Is there a work-around?
This works fine in ruby 1.9, which correctly deals with unicode:
In ruby 1.8 is broken, since it didn’t have the same support for unicode strings and those apostrophes are non 1-byte ascii characters, they are multi-byte unicode characters (when encoded as UTF-8, for example).