From: Julian 'Julik' Tarkhanov Date: 2006-06-15T23:25:50+09:00 Subject: Re: A plan for another unicode string hack On 15-jun-2006, at 15:59, Paul Battley wrote: > On 15/06/06, James Edward Gray II wrote: >> On Jun 15, 2006, at 8:13 AM, Patrick Hurley wrote: >> >> > I have to concur. If we are taking votes, I like the byte_ prefix: >> > byte_size, byte_length -- and these will remain important even >> within >> > pure ruby (e.g. when doing block based IO). >> >> I agree. > > I don't agree. If you are doing block-based IO with a string, wouldn't > the best way be just to set its encoding to raw/unset? It would then > behave as a byte-based string. There's no need for a whole suite of > byte_-prefixed methods. You do need them because otherwise you have to switch contexts just to access bytes transparently: with_some_context do byte_length = str.length end What I would love to have though is a reverse of my accessor thingy - so that we have a String#bytes, which bypasses to a byte string, but the methods of the string itself are character-bound -- Julian 'Julik' Tarkhanov please send all personal mail to me at julik.nl