summaryrefslogtreecommitdiff
path: root/Python/codecs.c
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2007-06-12 05:53:00 +0000
committerMartin v. Löwis <martin@v.loewis.de>2007-06-12 05:53:00 +0000
commitf2bd45cf7a33054ccd40261650ce2df3876d522b (patch)
tree0694436697e97c5ec3e15154749623a8c2efbd32 /Python/codecs.c
parent7d9b5b3cd60a48c08990e5acc2e71a7907a01535 (diff)
downloadcpython-f2bd45cf7a33054ccd40261650ce2df3876d522b.tar.gz
Revert 55876. Use PyUnicode_AsEncodedString instead.
Diffstat (limited to 'Python/codecs.c')
-rw-r--r--Python/codecs.c17
1 files changed, 0 insertions, 17 deletions
diff --git a/Python/codecs.c b/Python/codecs.c
index 1ba6009122..3aa1f386e7 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;