faq
flatforty
contribute
subscribe
configure
search
rdf
main
parent
thread
|
Re: Ruby FTW
by Chris on Friday 08/Feb/2008, @11:42
|
If you don't hear much, I'll add one:
Ruby is said to be sh** at Unicode, even worse than Python. Wonder if anyone can say something more clearly on that, as I always dreamt about switching. Oh, well, quite off topic here. But a small reminder that ppl working with Unicode still suffer from huge amounts of bugs and inconsistencies, when they actually should be producing code... |
|
|
The Fine Print: The following comments
are owned by whomever posted them.
( Reply )
|
Re: Ruby FTW
by Patcito on Friday 08/Feb/2008, @16:59
|
I've been using ruby for 3 years and never had a problem with unicode. Plus, unlike Python, ruby is developed by Japanese guys so you can bet they know how to deal with encoding. 1.9 even comes with awesome m17n.
|
[
Reply To This | View ]
|
Re: Ruby FTW
by Chris on Saturday 09/Feb/2008, @04:43
|
When I say Unicode I mean seamless integration à la Java. But instead "encoding error" here, "module currently doesn't support Unicode" there.
Ruby was said [1] to lack proper Unicode support as the leading Japanese guy doesn't like Unicode (many Japanese ppl seam to dislike Han-Unification). A lot of hearsay here though, sorry.
[1] http://blog.ianbicking.org/why-python-unicode-sucks.html
|
[
Reply To This | View ]
|
Re: Ruby FTW
by Richard Dale on Monday 11/Feb/2008, @06:25
|
Ruby uses a global variable $KCODE to set the default encoding - either ascii, UTF8 or two Japanese/Korean encodings, which is very similar to the 'setdefaultencoding()' function in your python link.
In QtRuby or Korundum for Qt or KDE programming in Ruby, you can display Unicode strings from UI code you have set up in Qt Designer by setting $KCODE to 'u'. As far as I know that is good enough for a lot of use cases. If you want your code to depend on non-ascii collating sequences and regular expression matching you need to be very careful anyway, whichever language you are using.
A Ruby String is a sequence of bytes with a length, and how your interpret it depends on the encoding you are using. There will never be two sorts of strings as in Python. Java has only one sort of string, and so it might not be as convenient for handling non-UTF strings. There is no right answer - language encoding is a complicated subject.
|
[
Reply To This | View ]
|
Re: Ruby FTW
by Chris on Monday 11/Feb/2008, @15:20
|
"language encoding is a complicated subject."
I strongly disagree. It might be now, but hopefully in 10 years we will think somebody is randomly generating characters once we see the string "ISO 8859-1".
In my eyes there is no usage for any other encodings except the Unicode ones, except again there are should be some codes Unicode why so ever would decide to not include. Well, there's still a private area in the code table for own use though.
I hope then the Python ppl will say: F* me, but that was one bad decision 10+ years ago.
|
[
Reply To This | View ]
|
|
The Fine Print: The previous
comments are owned by whomever posted them.
( Reply )
|
|