[Python-Dev] RE: [Patches] [Patch #100745] Fix PR #384, fixes UTF-8 en/decode

Bill Tutt rassilon@list.org
Thu, 6 Jul 2000 14:16:50 -0700 (PDT)


On Thu, 6 Jul 2000, Guido van Rossum wrote:

> > In any event, having the typedef is still useful since it clarifies the
> > meaning behind the code.
> 

How about this:
/*
 * Use this typedef when you need to represent a UTF-16 surrogate pair
 * as single unsigned integer.
 */
#if SIZEOF_INT >= 4 
typedef unsigned int Py_UCS4; 
#else
#if SIZEOF_LONG >= 4
typedef unsigned long Py_UCS4; 
#else
#error "can't find integral type that can contain 32 bits"
#endif /* SIZEOF_LONG */
#endif /* SIZEOF_INT */

Bill