From: Austin Ziegler Date: 2006-06-15T21:17:58+09:00 Subject: Re: A plan for another unicode string hack On 6/15/06, Paul Battley wrote: > On 15/06/06, Yukihiro Matsumoto wrote: > > |I agree with Austin on this - the distinction is too vague. I'd leave > > |length and size the same and make a size_in_bytes method. > > > > On my latest prototype (not checked in anywhere), String#length and > > String#size behave same, and there is String#buffer_size to return > > size in bytes. The method name might change in the future. > Actually, this makes a lot of sense. Why would you ever want to know > the actual byte length of a UTF-8 string? It's pretty meaningless for > most string-processing tasks: the main times you would need it would > be in allocation and interfacing with external systems and libraries. > Thus, something like buffer_size maps to real-world usage extremely > well, in my opinion. I agree. #buffer_size or #byte_size is probably sufficient. #size and #length should return the number of glyphs in the string. -austin -- Austin Ziegler * halostatue@gmail.com * http://www.halostatue.ca/ * austin@halostatue.ca * http://www.halostatue.ca/feed/ * austin@zieglers.ca