perky 02/04/27 18:03:50
Modified: korean/python euc_kr.py
Log:
- Fix error handling on trailing uncompleted character
Revision Changes Path
1.4 +3 -2 KoreanCodecs/korean/python/euc_kr.py
Index: euc_kr.py
===================================================================
RCS file: /cvsroot/koco/KoreanCodecs/korean/python/euc_kr.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- euc_kr.py 16 Mar 2002 02:35:20 -0000 1.3
+++ euc_kr.py 28 Apr 2002 01:03:49 -0000 1.4
@@ -1,7 +1,7 @@
# Hye-Shik Chang <16 Feb 2002>
# originally written by Tamito KAJIYAMA
#
-# $Id: euc_kr.py,v 1.3 2002/03/16 02:35:20 perky Exp $
+# $Id: euc_kr.py,v 1.4 2002/04/28 01:03:49 perky Exp $
import codecs
@@ -89,7 +89,8 @@
if errors == 'replace':
buffer.append(u'\uFFFD') # REPLACEMENT CHARACTER
elif errors == 'strict':
- raise UnicodeError, "unexpected byte 0x%02x%02x found" % tuple(map(ord, c))
+ raise UnicodeError, "unexpected byte 0x%s found" % (
+ ''.join(["%02x"%ord(x) for x in c]) )
return (u''.join(buffer), size)
|