On Sat, 18 Aug 2012 19:59:32 +0100, MRAB wrote:

> The problem with strings containing surrogate pairs is that you could
> inadvertently slice the string in the middle of the surrogate pair.

That's the *least* of the problems with surrogate pairs. That would be 
easy to fix: check the point of the slice, and back up or forward if 
you're on a surrogate pair. But that's not good enough, because the 
surrogates could be anywhere in the string. You have to touch every 
single character in order to know how many there are.

The problem with surrogate pairs is that they make basic string 
operations O(N) instead of O(1).



-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to