From 427dbff8f04a3a34703bf8a1faec77ad334f1d01 Mon Sep 17 00:00:00 2001 From: "Martin v. Löwis" Date: Tue, 12 Jun 2007 05:53:00 +0000 Subject: Revert 55876. Use PyUnicode_AsEncodedString instead. --- Python/codecs.c | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'Python/codecs.c') diff --git a/Python/codecs.c b/Python/codecs.c index 1ba60091226..3aa1f386e7b 100644 --- a/Python/codecs.c +++ b/Python/codecs.c @@ -319,23 +319,6 @@ PyObject *PyCodec_Encode(PyObject *object, 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; -- cgit v1.2.3