[I18n-sig] Unicode surrogates: just say no!

Paul Prescod paulp@ActiveState.com
Wed, 27 Jun 2001 12:50:24 -0700

Guido van Rossum wrote:
> Oooh, hadn't thought of that, but yes, it makes sense!
> Not yet implemented, but I think it should.  Makes for a nice pair
> of invariants:
>   unichr(ord('\Udddddddd')) == '\Udddddddd'
>   ord(unichr(0xdddddddd)) == 0xdddddddd
> regardless of whether we're using UCS-2 or UCS-4 storage.

I'm going to presume that ord should accept surrogate pairs on both
narrow and wide interpreters.

Take a recipe. Leave a recipe.  
Python Cookbook!  http://www.ActiveState.com/pythoncookbook