Back to index

python3.2  3.2.2
Public Member Functions
test.test_codecs.SurrogateEscapeTest Class Reference

List of all members.

Public Member Functions

def test_utf8
def test_ascii
def test_charmap
def test_latin1

Detailed Description

Definition at line 1596 of file test_codecs.py.


Member Function Documentation

Definition at line 1610 of file test_codecs.py.

01610 
01611     def test_ascii(self):
01612         # bad byte
01613         self.assertEqual(b"foo\x80bar".decode("ascii", "surrogateescape"),
01614                          "foo\udc80bar")
01615         self.assertEqual("foo\udc80bar".encode("ascii", "surrogateescape"),
01616                          b"foo\x80bar")

Here is the call graph for this function:

Definition at line 1617 of file test_codecs.py.

01617 
01618     def test_charmap(self):
01619         # bad byte: \xa5 is unmapped in iso-8859-3
01620         self.assertEqual(b"foo\xa5bar".decode("iso-8859-3", "surrogateescape"),
01621                          "foo\udca5bar")
01622         self.assertEqual("foo\udca5bar".encode("iso-8859-3", "surrogateescape"),
01623                          b"foo\xa5bar")

Here is the call graph for this function:

Definition at line 1624 of file test_codecs.py.

01624 
01625     def test_latin1(self):
01626         # Issue6373
01627         self.assertEqual("\udce4\udceb\udcef\udcf6\udcfc".encode("latin1", "surrogateescape"),
01628                          b"\xe4\xeb\xef\xf6\xfc")
01629 

Here is the call graph for this function:

Definition at line 1598 of file test_codecs.py.

01598 
01599     def test_utf8(self):
01600         # Bad byte
01601         self.assertEqual(b"foo\x80bar".decode("utf-8", "surrogateescape"),
01602                          "foo\udc80bar")
01603         self.assertEqual("foo\udc80bar".encode("utf-8", "surrogateescape"),
01604                          b"foo\x80bar")
01605         # bad-utf-8 encoded surrogate
01606         self.assertEqual(b"\xed\xb0\x80".decode("utf-8", "surrogateescape"),
01607                          "\udced\udcb0\udc80")
01608         self.assertEqual("\udced\udcb0\udc80".encode("utf-8", "surrogateescape"),
01609                          b"\xed\xb0\x80")

Here is the call graph for this function:


The documentation for this class was generated from the following file: