summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2000-05-09 19:51:53 (GMT)
committerFred Drake <fdrake@acm.org>2000-05-09 19:51:53 (GMT)
commitcb093fe8909146f02ac02b218a7b46800f87a76f (patch)
treed723c553b3256cb8743bd935891c9858cc724a99 /Include
parent3ac3edcf95c5acd1644951e90bde9b0436f61fd7 (diff)
downloadcpython-cb093fe8909146f02ac02b218a7b46800f87a76f.zip
cpython-cb093fe8909146f02ac02b218a7b46800f87a76f.tar.gz
cpython-cb093fe8909146f02ac02b218a7b46800f87a76f.tar.bz2
M.-A. Lemburg <mal@lemburg.com>:
Added PyUnicode_GetDefaultEncoding() and PyUnicode_GetDefaultEncoding() APIs.
Diffstat (limited to 'Include')
-rw-r--r--Include/unicodeobject.h30
1 files changed, 26 insertions, 4 deletions
diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h
index 9c05010..bed3b7b 100644
--- a/Include/unicodeobject.h
+++ b/Include/unicodeobject.h
@@ -265,8 +265,8 @@ extern DL_IMPORT(int) PyUnicode_Resize(
refcount.
2. String and other char buffer compatible objects are decoded
- under the assumptions that they contain UTF-8 data. Decoding
- is done in "strict" mode.
+ under the assumptions that they contain data using the current
+ default encoding. Decoding is done in "strict" mode.
3. All other objects raise an exception.
@@ -313,8 +313,7 @@ extern DL_IMPORT(int) PyUnicode_AsWideChar(
parameters encoding and errors have the same semantics as the ones
of the builtin unicode() API.
- Setting encoding to NULL causes the default encoding to be used
- which is UTF-8.
+ Setting encoding to NULL causes the default encoding to be used.
Error handling is set by errors which may also be set to NULL
meaning to use the default handling defined for the codec. Default
@@ -326,6 +325,29 @@ extern DL_IMPORT(int) PyUnicode_AsWideChar(
*/
+/* --- Manage the default encoding ---------------------------------------- */
+
+/* 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.
+
+ */
+
+extern DL_IMPORT(const char*) PyUnicode_GetDefaultEncoding();
+
+/* Sets the currently active default encoding.
+
+ Returns 0 on success, -1 in case of an error.
+
+ */
+
+extern DL_IMPORT(int) PyUnicode_SetDefaultEncoding(
+ const char *encoding /* Encoding name in standard form */
+ );
+
/* --- Generic Codecs ----------------------------------------------------- */
/* Create a Unicode object by decoding the encoded string s of the