Mercurial > cpython-lru_cache-weakref
comparison Modules/python.c @ 53966:7c29bfbfd352
Rename utf8b error handler to surrogateescape.
| author | Martin v. Löwis <martin@v.loewis.de> |
|---|---|
| date | Sun, 10 May 2009 08:15:24 +0000 |
| parents | ac209f132b17 |
| children | ec5d228a83ef |
comparison
equal
deleted
inserted
replaced
| 53965:fbcdae3e0ca1 | 53966:7c29bfbfd352 |
|---|---|
| 40 count = mbstowcs(res, arg, argsize+1); | 40 count = mbstowcs(res, arg, argsize+1); |
| 41 if (count != (size_t)-1) | 41 if (count != (size_t)-1) |
| 42 return res; | 42 return res; |
| 43 PyMem_Free(res); | 43 PyMem_Free(res); |
| 44 } | 44 } |
| 45 /* Conversion failed. Fall back to escaping with utf8b. */ | 45 /* Conversion failed. Fall back to escaping with surrogateescape. */ |
| 46 #ifdef HAVE_MBRTOWC | 46 #ifdef HAVE_MBRTOWC |
| 47 /* Try conversion with mbrtwoc (C99), and escape non-decodable bytes. */ | 47 /* Try conversion with mbrtwoc (C99), and escape non-decodable bytes. */ |
| 48 | 48 |
| 49 /* Overallocate; as multi-byte characters are in the argument, the | 49 /* Overallocate; as multi-byte characters are in the argument, the |
| 50 actual output could use less memory. */ | 50 actual output could use less memory. */ |
