On 15-jun-2006, at 16:26, Dae San Hwang wrote: > On Jun 15, 2006, at 9:03 PM, Julian 'Julik' Tarkhanov wrote: > >> To the original poster - frankly I don't see the point of doing >> this all over again. If you want to have unicode handling >> that way just grab it from my plugin. It's just that when you have >> to work with external libraries they >> will not cooperate. I was using this String class in the wild for >> a few months, so trust me. It's not simply >> because I "felt" like removing this functionality - it simply >> Broke Alot Of Stuff In A Variety Of Subtle Ways. > > Hi Julian. I have tried your plugin in the past and I appreciate > your efforts on better unicode supports on Ruby. The reason I'm > proposing a different hack is because people have been advising > against the use of your unicode hack due to its incompatibilities > with other libraries. So, I figured that we need a way of > differentiating between plain old string and new hacked string with > explicit encoding. (I got the hint and inspiration from http:// > redhanded.hobix.com/inspect/futurismUnicodeInRuby.html) That way it > can be backward compatible with existing libraries and yet be > forward compatible with Ruby 2.0. Interesting what you are going to come up with. Especially when you pass a "flagged" string to routines such as CGI.escape which cannot tolerate codepoint-based String#size. > >> Separation of "size" and "length" is sensless because they are >> aliases in Ruby. It would be sensible >> to have "byte_" prefixed methods for byte access, just as I had in >> my hacks plugin a while ago. It worked too. > > My proposal for differentiating method names between 'size' and > 'length' has risen from my personal itch. I have always appreciated > Ruby's intuitiveness and I think 'size' is an intuitively better > name for byte size of a string and 'length' is better suited to > give the length of a string. I might be being compulsive here but I > think this kind of attention to details have earned the title of > the programer friendly language to Ruby. Guy Decoux have pointed > out that Matz has considered this change himself once and obviously > many people on the forum welcome this change. (Equal number of > people voted against it as well, 7:7 at the moment.) I'm really eager to see if it works out for you. Ples keep us posted. -- Julian 'Julik' Tarkhanov please send all personal mail to me at julik.nl