Mercurial > cpython-lru_cache-weakref
diff Python/codecs.c @ 42057:3473a685e5e7
Revert 55876. Use PyUnicode_AsEncodedString instead.
| author | Martin v. Löwis <martin@v.loewis.de> |
|---|---|
| date | Tue, 12 Jun 2007 05:53:00 +0000 |
| parents | 36b8d74deb9e |
| children | 5f9e79d1e158 |
line wrap: on
line diff
--- a/Python/codecs.c Tue Jun 12 00:41:35 2007 +0000 +++ b/Python/codecs.c Tue Jun 12 05:53:00 2007 +0000 @@ -319,23 +319,6 @@ PyObject *args = NULL, *result = NULL; PyObject *v; - /* XXX short-cut a few common file system - encodings for now, as otherwise the import - code can't load the codec registry. */ - if (strcmp(encoding, "utf-8") == 0 && PyUnicode_Check(object)) { - return PyUnicode_EncodeUTF8(PyUnicode_AS_UNICODE(object), - PyUnicode_GET_SIZE(object), - errors); - } -#if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T) - if (strcmp(encoding, "mbcs") == 0 && PyUnicode_Check(object)) { - return PyUnicode_EncodeMBCS(PyUnicode_AS_UNICODE(object), - PyUnicode_GET_SIZE(object), - errors); - } -#endif - - encoder = PyCodec_Encoder(encoding); if (encoder == NULL) goto onError;
