From: Eric Hodel Date: 2009-04-22T07:13:39+09:00 Subject: Re: special characters screwing up string operations On Apr 21, 2009, at 12:41, Aryk Grosz wrote: > Im doing some manipulation of strings, and there are some characters > that Ruby just really does not like: > > “ – > > If you try to paste these into a Ruby console the cursor will jump > around. Likewise, if you put it in a string and try to do text[5,4] it > will give you the wrong piece of the text. > > How do I get around this. Is there some special escape command or do I > just have to gsub these characters? My console doesn't allow me to paste these characters into irb (OS X, it beeps when I try) so I think it is Readline's fault. I can read them with gets: $ ruby -e 'p gets' “ – "\342\200\234 \342\200\223\n" You'll probably need to adjust your terminal settings to accept these characters.