summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorMarc-André Lemburg <mal@egenix.com>2008-04-29 11:14:08 (GMT)
committerMarc-André Lemburg <mal@egenix.com>2008-04-29 11:14:08 (GMT)
commit9155aa742cf5342e4033dce01458d0d2d9d54cd9 (patch)
tree3effb13f09c9355ff6220c53ed8e282654a79ef8 /Include
parenta2f837f751bd38c85636c6431a11b216228da92e (diff)
downloadcpython-9155aa742cf5342e4033dce01458d0d2d9d54cd9.zip
cpython-9155aa742cf5342e4033dce01458d0d2d9d54cd9.tar.gz
cpython-9155aa742cf5342e4033dce01458d0d2d9d54cd9.tar.bz2
Cleanup the Unicode header documentation and formatting a bit.
Diffstat (limited to 'Include')
-rw-r--r--Include/unicodeobject.h33
1 files changed, 22 insertions, 11 deletions
diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h
index 5e6c227..4582348 100644
--- a/Include/unicodeobject.h
+++ b/Include/unicodeobject.h
@@ -660,7 +660,8 @@ PyAPI_FUNC(PyObject*) PyUnicode_FromOrdinal(int ordinal);
*/
PyAPI_FUNC(PyObject *) _PyUnicode_AsDefaultEncodedString(
- PyObject *, const char *);
+ PyObject *unicode,
+ const char *errors);
/* Decode a null-terminated string using Py_FileSystemDefaultEncoding.
@@ -681,26 +682,36 @@ PyAPI_FUNC(PyObject*) PyUnicode_DecodeFSDefaultAndSize(
Py_ssize_t size /* size */
);
+/* Returns a pointer to the default encoding (normally, UTF-8) of the
+ Unicode object unicode and the size of the encoded representation
+ in bytes stored in *size.
-/* Return a char* holding the UTF-8 encoded value of the
- Unicode object.
+ In case of an error, no *size is set.
- DEPRECATED: use PyUnicode_AsStringAndSize() instead.
*/
-PyAPI_FUNC(char *) PyUnicode_AsStringAndSize(PyObject*, Py_ssize_t *);
+PyAPI_FUNC(char *) PyUnicode_AsStringAndSize(
+ PyObject *unicode,
+ Py_ssize_t *size);
-/* Returns the UTF-8 encoding, and its size.
+/* Returns a pointer to the default encoding (normally, UTf-8) of the
+ Unicode object unicode.
- If the output argument is NULL, no size is stored.
- */
+ Use of this API is DEPRECATED since no size information can be
+ extracted from the returned data. Use PyUnicode_AsStringAndSize()
+ instead.
-PyAPI_FUNC(char *) PyUnicode_AsString(PyObject*);
+*/
-/* Returns the UTF-8 encoding.
+PyAPI_FUNC(char *) PyUnicode_AsString(PyObject *unicode);
- This is equivalent to PyUnicode_AsStringAndSize(x, NULL).
+/* Returns the currently active default encoding.
+ The default encoding is currently implemented as run-time settable
+ process global. This may change in future versions of the
+ interpreter to become a parameter which is managed on a per-thread
+ basis.
+
*/
PyAPI_FUNC(const char*) PyUnicode_GetDefaultEncoding(void);