summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/output/test_minidom3
-rw-r--r--Lib/test/test_minidom.py8
2 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/output/test_minidom b/Lib/test/output/test_minidom
index fc1017b..1612f10 100644
--- a/Lib/test/output/test_minidom
+++ b/Lib/test/output/test_minidom
@@ -98,6 +98,9 @@ Passed assertion: len(Node.allnodes) == 0
Passed Test
Test Succeeded testElementReprAndStr
Passed assertion: len(Node.allnodes) == 0
+Passed testEncodings - encoding EURO SIGN
+Test Succeeded testEncodings
+Passed assertion: len(Node.allnodes) == 0
Test Succeeded testFirstChild
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testGetAttrLength
diff --git a/Lib/test/test_minidom.py b/Lib/test/test_minidom.py
index 4483fc5..d398d73 100644
--- a/Lib/test/test_minidom.py
+++ b/Lib/test/test_minidom.py
@@ -606,6 +606,14 @@ def testSAX2DOM():
doc.unlink()
+def testEncodings():
+ doc = parseString('<foo>&#x20ac;</foo>')
+ confirm(doc.toxml() == u'<?xml version="1.0" ?>\n<foo>\u20ac</foo>'
+ and doc.toxml('utf-8') == '<?xml version="1.0" encoding="utf-8"?>\n<foo>\xe2\x82\xac</foo>'
+ and doc.toxml('iso-8859-15') == '<?xml version="1.0" encoding="iso-8859-15"?>\n<foo>\xa4</foo>',
+ "testEncodings - encoding EURO SIGN")
+ doc.unlink()
+
# --- MAIN PROGRAM
names = globals().keys()