summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorMarc-André Lemburg <mal@egenix.com>2002-08-11 12:23:04 (GMT)
committerMarc-André Lemburg <mal@egenix.com>2002-08-11 12:23:04 (GMT)
commitcc8764ca9dc3fceb9dc283163a89c9bb649b5392 (patch)
tree7f4c069636e05afe04482cc42c38f1937818806d /Include
parent078151da901bebce6eb232d958fbbb1e5ced4399 (diff)
downloadcpython-cc8764ca9dc3fceb9dc283163a89c9bb649b5392.zip
cpython-cc8764ca9dc3fceb9dc283163a89c9bb649b5392.tar.gz
cpython-cc8764ca9dc3fceb9dc283163a89c9bb649b5392.tar.bz2
Add C API PyUnicode_FromOrdinal() which exposes unichr() at C level.
u'%c' will now raise a ValueError in case the argument is an integer outside the valid range of Unicode code point ordinals. Closes SF bug #593581.
Diffstat (limited to 'Include')
-rw-r--r--Include/unicodeobject.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h
index d0a2885..2a92fe5 100644
--- a/Include/unicodeobject.h
+++ b/Include/unicodeobject.h
@@ -517,6 +517,18 @@ extern DL_IMPORT(int) PyUnicode_AsWideChar(
#endif
+/* --- Unicode ordinals --------------------------------------------------- */
+
+/* Create a Unicode Object from the given Unicode code point ordinal.
+
+ The ordinal must be in range(0x10000) on narrow Python builds
+ (UCS2), and range(0x110000) on wide builds (UCS4). A ValueError is
+ raised in case it is not.
+
+*/
+
+extern DL_IMPORT(PyObject*) PyUnicode_FromOrdinal(int ordinal);
+
/* === Builtin Codecs =====================================================
Many of these APIs take two arguments encoding and errors. These