[Python-checkins] python/dist/src/Include unicodeobject.h, 2.43, 2.44

lemburg at users.sourceforge.net lemburg at users.sourceforge.net
Thu Jul 8 19:57:34 CEST 2004


Update of /cvsroot/python/python/dist/src/Include
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10211/Include

Modified Files:
	unicodeobject.h 
Log Message:
Allow string and unicode return types from .encode()/.decode()
methods on string and unicode objects. Added unicode.decode()
which was missing for no apparent reason.



Index: unicodeobject.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/unicodeobject.h,v
retrieving revision 2.43
retrieving revision 2.44
diff -C2 -d -r2.43 -r2.44
*** unicodeobject.h	2 Jun 2004 16:49:08 -0000	2.43
--- unicodeobject.h	8 Jul 2004 17:57:30 -0000	2.44
***************
*** 142,145 ****
--- 142,146 ----
  # define PyUnicode_AsASCIIString PyUnicodeUCS2_AsASCIIString
  # define PyUnicode_AsCharmapString PyUnicodeUCS2_AsCharmapString
+ # define PyUnicode_AsEncodedObject PyUnicodeUCS2_AsEncodedObject
  # define PyUnicode_AsEncodedString PyUnicodeUCS2_AsEncodedString
  # define PyUnicode_AsLatin1String PyUnicodeUCS2_AsLatin1String
***************
*** 216,219 ****
--- 217,221 ----
  # define PyUnicode_AsASCIIString PyUnicodeUCS4_AsASCIIString
  # define PyUnicode_AsCharmapString PyUnicodeUCS4_AsCharmapString
+ # define PyUnicode_AsEncodedObject PyUnicodeUCS4_AsEncodedObject
  # define PyUnicode_AsEncodedString PyUnicodeUCS4_AsEncodedString
  # define PyUnicode_AsLatin1String PyUnicodeUCS4_AsLatin1String
***************
*** 627,630 ****
--- 629,641 ----
      );
  
+ /* Encodes a Unicode object and returns the result as Python
+    object. */
+ 
+ PyAPI_FUNC(PyObject*) PyUnicode_AsEncodedObject(
+     PyObject *unicode,	 	/* Unicode object */
+     const char *encoding,	/* encoding */
+     const char *errors		/* error handling */
+     );
+ 
  /* Encodes a Unicode object and returns the result as Python string
     object. */



More information about the Python-checkins mailing list