Author: guido.van.rossum
Date: Thu May 17 20:56:39 2007
New Revision: 55410
Modified:
python/branches/py3k-struni/Modules/cjkcodecs/cjkcodecs.h
Log:
Allow encoding names to be unicode strings.
Modified: python/branches/py3k-struni/Modules/cjkcodecs/cjkcodecs.h
==============================================================================
--- python/branches/py3k-struni/Modules/cjkcodecs/cjkcodecs.h (original)
+++ python/branches/py3k-struni/Modules/cjkcodecs/cjkcodecs.h Thu May 17
20:56:39 2007
@@ -261,6 +261,11 @@
const MultibyteCodec *codec;
const char *enc;
+ if (PyUnicode_Check(encoding)) {
+ encoding = _PyUnicode_AsDefaultEncodedString(encoding, NULL);
+ if (encoding == NULL)
+ return NULL;
+ }
if (!PyString_Check(encoding)) {
PyErr_SetString(PyExc_TypeError,
"encoding name must be a string.");
_______________________________________________
Python-3000-checkins mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000-checkins