Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv21136/Objects Modified Files: unicodectype.c Log Message: Make lower/upper/title work for non-BMP characters. Index: unicodectype.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/unicodectype.c,v retrieving revision 2.12 retrieving revision 2.13 diff -C2 -d -r2.12 -r2.13 *** unicodectype.c 18 Oct 2002 16:11:53 -0000 2.12 --- unicodectype.c 18 Oct 2002 16:40:36 -0000 2.13 *************** *** 63,78 **** { const _PyUnicode_TypeRecord *ctype = gettyperecord(ch); if (ctype->title) ! ch += ctype->title; else ! ch += ctype->upper; ! #ifdef Py_UNICODE_WIDE ! /* The database assumes that the values wrap around at 0x10000. */ ! if (ch > 0x10000) ! ch -= 0x10000; ! #endif ! return ch; } --- 63,77 ---- { const _PyUnicode_TypeRecord *ctype = gettyperecord(ch); + int delta; if (ctype->title) ! delta = ctype->title; else ! delta = ctype->upper; ! if (delta >= 32768) ! delta -= 65536; ! ! return ch + delta; } *************** *** 359,370 **** { const _PyUnicode_TypeRecord *ctype = gettyperecord(ch); ! ! ch += ctype->upper; ! #ifdef Py_UNICODE_WIDE ! /* The database assumes that the values wrap around at 0x10000. */ ! if (ch > 0x10000) ! ch -= 0x10000; ! #endif ! return ch; } --- 358,365 ---- { const _PyUnicode_TypeRecord *ctype = gettyperecord(ch); ! int delta = ctype->upper; ! if (delta >= 32768) ! delta -= 65536; ! return ch + delta; } *************** *** 375,386 **** { const _PyUnicode_TypeRecord *ctype = gettyperecord(ch); ! ! ch += ctype->lower; ! #ifdef Py_UNICODE_WIDE ! /* The database assumes that the values wrap around at 0x10000. */ ! if (ch > 0x10000) ! ch -= 0x10000; ! #endif ! return ch; } --- 370,377 ---- { const _PyUnicode_TypeRecord *ctype = gettyperecord(ch); ! int delta = ctype->lower; ! if (delta >= 32768) ! delta -= 65536; ! return ch + delta; }
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4