From 01bd68684611585d437982dccdf05b33cbedc630 Mon Sep 17 00:00:00 2001 From: Chris Angelico Date: Sat, 7 Jun 2014 11:33:43 +1000 Subject: [PATCH] Expand the Unicode tests --- tests/basics/unicode.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/basics/unicode.py b/tests/basics/unicode.py index a52cb79c3d..ee66679b8d 100644 --- a/tests/basics/unicode.py +++ b/tests/basics/unicode.py @@ -1,3 +1,9 @@ +# Test a UTF-8 encoded literal s = "asdf©qwer" for i in range(len(s)): - print("s[%d]: %s"%(i, s[i])) + print("s[%d]: %s %X"%(i, s[i], ord(s[i]))) +# Test all three forms of Unicode escape, and +# all blocks of UTF-8 byte patterns +s = "a\xA9\xFF\u0123\u0800\uFFEE\U0001F44C" +for i in range(len(s)): + print("s[%d]: %s %X"%(i, s[i], ord(s[i])))