Re: How do you feel about utf-8 in ruby code?
Peter Hickman <[email protected]>
| Newsgroups | gmane.comp.lang.ruby.general |
|---|---|
| Message-ID | <CALxYQy7GsT0tvD81StRikRon=98==7_t7jVicuQyyq46JJpNaw@mail.gmail.com> |
Gerald, thank you for providing the perfect example of why using unicode is such a bad idea. Lets take the line you gave: Hash‹Address→Hash‹Address→Game›› Now I don't know which actual code point your › is but here is a list of unicode code points that look similar (and there are probably more) U+003E > U+02C3 ˃ U+02F2 ˲ <-- In my editor this looks like a squished U+02C3, but in Gmail this looks like a , to me. Go figure U+203A › U+227B ≻ So to work on your code I would be forced to cut and paste all the time to guarantee I was using the correct code point. That is not going to be a pleasant experience and is definitely going to be a source of bugs As a bonus let us take the end of the line, the ››, which we can assume is just two › code points. Well how about: U+00BB » U+226B ≫ Visually similar, especially U+00BB, but incorrect Until all editors, mail clients etc handle unicode correctly (trust me here U+02F2 visually similar to > in my editor but looks like a , in gmail - perhaps you are not seeing this though, who can tell) this is simply a source of confusion Unicode is nice and all but seems to offer no advantage in this case. Rather it can be a source of frustration and bugs Unsubscribe: <mailto:[email protected]?subject=unsubscribe> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>