[pypy-svn] r16165 - pypy/dist/pypy/module/_codecs

ale at codespeak.net ale at codespeak.net
Fri Aug 19 16:32:45 CEST 2005


Author: ale
Date: Fri Aug 19 16:32:44 2005
New Revision: 16165

Modified:
   pypy/dist/pypy/module/_codecs/app_codecs.py
Log:
corrected utf-16 decoding (should be called with byteorder = 'native'

added 'final' to the signature (not used)

Modified: pypy/dist/pypy/module/_codecs/app_codecs.py
==============================================================================
--- pypy/dist/pypy/module/_codecs/app_codecs.py	(original)
+++ pypy/dist/pypy/module/_codecs/app_codecs.py	Fri Aug 19 16:32:44 2005
@@ -274,7 +274,7 @@
         res = u''.join(p)
         return res, len(res)
 
-def utf_16_ex_decode( data,errors='strict'):
+def utf_16_ex_decode( data,errors='strict',final = True):
     """None
     """
     res = PyUnicode_DecodeUTF16Stateful(data,len(data),errors,'native')
@@ -368,7 +368,7 @@
 def utf_16_encode( obj,errors='strict'):
     """None
     """
-    res = PyUnicode_EncodeUTF16(obj,len(obj),errors)
+    res = PyUnicode_EncodeUTF16(obj,len(obj),errors,'native')
     res = ''.join(res)
     return res, len(res)
 
@@ -400,14 +400,14 @@
     res = ''.join(res)
     return res, len(res)
 
-def utf_16_le_decode( data,errors='strict'):
+def utf_16_le_decode( data,errors='strict',final = True):
     """None
     """
     res = PyUnicode_DecodeUTF16Stateful(data,len(data),errors,'little')
     res = ''.join(res)
     return res, len(res)
 
-def utf_16_be_decode( data,errors='strict'):
+def utf_16_be_decode( data,errors='strict',final = True):
     """None
     """
     res = PyUnicode_DecodeUTF16Stateful(data,len(data),errors,'big')
@@ -1332,6 +1332,7 @@
     return res
 
 hexdigits = [hex(i)[-1] for i in range(16)]+[hex(i)[-1].upper() for i in range(10,16)]
+
 def hexescape(s,pos,digits,message,errors):
     chr = 0
     p = []



More information about the Pypy-commit mailing list