summaryrefslogtreecommitdiffstats
path: root/Include/unicodeobject.h
diff options
context:
space:
mode:
authorWalter Dörwald <walter@livinglogic.de>2007-05-05 12:00:46 (GMT)
committerWalter Dörwald <walter@livinglogic.de>2007-05-05 12:00:46 (GMT)
commitacaa5a16d6cd9a94e7e111761264eef14a033d2c (patch)
treec2c2156bc64012da26a254caebdaf1a35b96f706 /Include/unicodeobject.h
parent1255ed62bfc2f9f8f5c50935c21cbe0a34e12cc7 (diff)
downloadcpython-acaa5a16d6cd9a94e7e111761264eef14a033d2c.zip
cpython-acaa5a16d6cd9a94e7e111761264eef14a033d2c.tar.gz
cpython-acaa5a16d6cd9a94e7e111761264eef14a033d2c.tar.bz2
Add PyUnicode_FromString(), which create a unicode object from a
const char * (i.e. 0-terminated latin-1 encoded bytes).
Diffstat (limited to 'Include/unicodeobject.h')
-rw-r--r--Include/unicodeobject.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h
index c12cb96..9d0cabf 100644
--- a/Include/unicodeobject.h
+++ b/Include/unicodeobject.h
@@ -172,6 +172,7 @@ typedef PY_UNICODE_TYPE Py_UNICODE;
# define PyUnicode_FromObject PyUnicodeUCS2_FromObject
# define PyUnicode_FromOrdinal PyUnicodeUCS2_FromOrdinal
# define PyUnicode_FromUnicode PyUnicodeUCS2_FromUnicode
+# define PyUnicode_FromString PyUnicodeUCS2_FromString
# define PyUnicode_FromWideChar PyUnicodeUCS2_FromWideChar
# define PyUnicode_GetDefaultEncoding PyUnicodeUCS2_GetDefaultEncoding
# define PyUnicode_GetMax PyUnicodeUCS2_GetMax
@@ -250,6 +251,7 @@ typedef PY_UNICODE_TYPE Py_UNICODE;
# define PyUnicode_FromObject PyUnicodeUCS4_FromObject
# define PyUnicode_FromOrdinal PyUnicodeUCS4_FromOrdinal
# define PyUnicode_FromUnicode PyUnicodeUCS4_FromUnicode
+# define PyUnicode_FromString PyUnicodeUCS4_FromString
# define PyUnicode_FromWideChar PyUnicodeUCS4_FromWideChar
# define PyUnicode_GetDefaultEncoding PyUnicodeUCS4_GetDefaultEncoding
# define PyUnicode_GetMax PyUnicodeUCS4_GetMax
@@ -427,6 +429,12 @@ PyAPI_FUNC(PyObject*) PyUnicode_FromUnicode(
Py_ssize_t size /* size of buffer */
);
+/* Similar to PyUnicode_FromUnicode(), but u points to null-terminated
+ Latin-1 encoded bytes */
+PyAPI_FUNC(PyObject*) PyUnicode_FromString(
+ const char *u /* string */
+ );
+
/* Return a read-only pointer to the Unicode object's internal
Py_UNICODE buffer. */