From: Michal Suchanek Date: 2006-06-15T21:10:28+09:00 Subject: Re: A plan for another unicode string hack On 6/14/06, Austin Ziegler wrote: > On 6/14/06, Dae San Hwang wrote: > > My proposed change won't disturb anyone's existing codes unless you > > set $KCODE to be 'u' as well in that code. If you did set $KCODE to > > 'u' in your previous projects, you don't have to apply this hack > > (which hasn't been implemented yet) to that project. > > Um. PDF::Writer is a library, and I think that I use both depending on > how the code reads. > > > Matz has said several times that he will maximize the breakage moving > > to Ruby 2.0. If Matz is going to make these changes for Ruby 2.0, (as > > implied in Guy Decoux's posting) I think I will just follow along. My > > goal is to provide Ruby 2.0 forward compatible unicode support until > > the move is complete. > > Yes, I undertstand. Making #size and #length return different values > is a mistake. Without referring to documentation, how would you know > which returns the number of characters and which one returns the > number of bytes? Well, to me it is quite intuitive that length gives the number of characters, and size returns the amount of space needed to store the object. The problem is that for other objects these would still be equivalent. But the subject contains the word 'hack', mind you. > > They should always *either* return characters or bytes (preferably > characters) and a separate call should be introduced for the > alternative meaning. One that is explicit in its name to match its > meaning. I think that more descriptive aliases would be welcome as well. Thanks Michal