From: Robert Klemme Date: 2009-12-15T06:10:05+09:00 Subject: Re: Ruby 1.9 string slicing and StringScanner pointers On 14.12.2009 18:07, James Edward Gray II wrote: > On Dec 14, 2009, at 10:55 AM, Robert Klemme wrote: > >> Btw, although UTF-16 is a fixed length encoding, > > UTF-16 is not a fixed length encoding. A UTF-16 character may be encoded in two or four bytes. > > I believe UTF-32 is fixed length, but even then it would not be cheap to index due to Unicode's use of "combining characters." With them multiple codepoints may represent a single index. Thanks for the education, James! I would have sword UTF-16 is fixed length... For reference of other readers: http://en.wikipedia.org/wiki/Utf-16 http://en.wikipedia.org/wiki/Combining_characters Combining characters - oh what a mess. I189 is really a minefield. Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/