[Python-checkins] CVS: python/dist/src/Include unicodeobject.h,2.8,2.9
Fred Drake
python-dev@python.org
Tue, 9 May 2000 15:51:56 -0400
Update of /projects/cvsroot/python/dist/src/Include
In directory seahag.cnri.reston.va.us:/home/fdrake/projects/python/Include
Modified Files:
unicodeobject.h
Log Message:
M.-A. Lemburg <mal@lemburg.com>:
Added PyUnicode_GetDefaultEncoding() and
PyUnicode_GetDefaultEncoding() APIs.
Index: unicodeobject.h
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Include/unicodeobject.h,v
retrieving revision 2.8
retrieving revision 2.9
diff -C2 -r2.8 -r2.9
*** unicodeobject.h 2000/04/11 15:39:46 2.8
--- unicodeobject.h 2000/05/09 19:51:53 2.9
***************
*** 266,271 ****
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.
3. All other objects raise an exception.
--- 266,271 ----
2. String and other char buffer compatible objects are decoded
! 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.
***************
*** 314,319 ****
of the builtin unicode() API.
! Setting encoding to NULL causes the default encoding to be used
! which is UTF-8.
Error handling is set by errors which may also be set to NULL
--- 314,318 ----
of the builtin unicode() API.
! Setting encoding to NULL causes the default encoding to be used.
Error handling is set by errors which may also be set to NULL
***************
*** 326,329 ****
--- 325,351 ----
*/
+
+ /* --- 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 ----------------------------------------------------- */