summaryrefslogtreecommitdiffstats
path: root/Include/codecs.h
diff options
context:
space:
mode:
authorMarc-André Lemburg <mal@egenix.com>2008-06-06 12:18:17 (GMT)
committerMarc-André Lemburg <mal@egenix.com>2008-06-06 12:18:17 (GMT)
commitb2750b5d334e9c8d262009069bce41c15803eca0 (patch)
tree2c501adf96b37d3afbc32e6fdc344fade85cf3d5 /Include/codecs.h
parent4efb518185d32d573ff65f11b94c6031340a018a (diff)
downloadcpython-b2750b5d334e9c8d262009069bce41c15803eca0.zip
cpython-b2750b5d334e9c8d262009069bce41c15803eca0.tar.gz
cpython-b2750b5d334e9c8d262009069bce41c15803eca0.tar.bz2
Move the codec decode type checks to bytes/bytearray.decode().
Use faster PyUnicode_FromEncodedObject() for bytes/bytearray.decode(). Add new PyCodec_KnownEncoding() API. Add new PyUnicode_AsDecodedUnicode() and PyUnicode_AsEncodedUnicode() APIs. Add missing PyUnicode_AsDecodedObject() to unicodeobject.h Fix punicode codec to also work on memoryviews.
Diffstat (limited to 'Include/codecs.h')
-rw-r--r--Include/codecs.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/Include/codecs.h b/Include/codecs.h
index 0d76241..c979e86 100644
--- a/Include/codecs.h
+++ b/Include/codecs.h
@@ -27,7 +27,7 @@ PyAPI_FUNC(int) PyCodec_Register(
PyObject *search_function
);
-/* Codec register lookup API.
+/* Codec registry lookup API.
Looks up the given encoding and returns a CodecInfo object with
function attributes which implement the different aspects of
@@ -49,6 +49,17 @@ PyAPI_FUNC(PyObject *) _PyCodec_Lookup(
const char *encoding
);
+/* Codec registry encoding check API.
+
+ Returns 1/0 depending on whether there is a registered codec for
+ the given encoding.
+
+*/
+
+PyAPI_FUNC(int) PyCodec_KnownEncoding(
+ const char *encoding
+ );
+
/* Generic codec based encoding API.
object is passed through the encoder function found for the given