Charles Oliver Nutter wrote: > Daniel DeLorme wrote: >> Austin Ziegler wrote: >>> No. #index always returns character position; it just so happens that >>> some encodings use bytes for their character position. >> >> That's just a different way of wording my concern :-P >> You'll still have inconsistencies if you forgot to set the proper >> encoding for one of your strings. THAT is my (admittedly tiny) concern. > > But that would be a bug in your code; if you don't encode a string, you > can't expect character positions to be meaningful for any encoding other > than one that just uses byte-sized characters. Well, yes, that would be a bug in my code. Just as if I did str.size (in 1.8) and expected to get a number of characters, that would also be a bug in my code. But that is being changed in 1.9 because, I presume, returning a number of characters is less prone to bugs. What I worry about is that the problem has simply been moved elsewhere, an elsewhere that is potentially more difficult to debug (so I'm a curmudgeon AND a worrywart; beat that!) Well anyway, I'll try to come up with some test cases; otherwise all this is just pointless speculation. Daniel