]> granicus.if.org Git - python/commitdiff
Don't test whether surrogate sequences round-trip in UTF-8. 2.2.2 candidate.
authorMartin v. Löwis <martin@v.loewis.de>
Sat, 14 Sep 2002 09:19:53 +0000 (09:19 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Sat, 14 Sep 2002 09:19:53 +0000 (09:19 +0000)
Lib/test/test_unicode.py

index a57d6f437259015c1ebd6cf8a88dd13ecab8a250..89e28b5b405f34dd9d846592d093588297285ba5 100644 (file)
@@ -695,7 +695,10 @@ for encoding in ('utf-8',
     verify(unicode(u.encode(encoding),encoding) == u)
 
 # UTF-8 must be roundtrip safe for all UCS-2 code points
-u = u''.join(map(unichr, range(0x10000)))
+# This excludes surrogates: in the full range, there would be
+# a surrogate pair (\udbff\udc00), which gets converted back
+# to a non-BMP character (\U0010fc00)
+u = u''.join(map(unichr, range(0,0xd800)+range(0xe000,0x10000)))
 for encoding in ('utf-8',):
     verify(unicode(u.encode(encoding),encoding) == u)