Created
December 9, 2014 17:50
-
-
Save ironpythonbot/72a6a557c77d0bb6d1c6 to your computer and use it in GitHub Desktop.
CodePlex Issue #29474 Plain Text Attachments
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
from xml.sax.saxutils import XMLGenerator | |
from StringIO import StringIO | |
class TestXmlGenerator(unittest.TestCase): | |
def test_encoding(self): | |
input = u'hyv\xe4' | |
output = StringIO() | |
XMLGenerator(output, encoding='UTF-8').characters(input) | |
self.assertEquals(output.getvalue(), input.encode('UTF-8')) | |
if __name__ == '__main__': | |
unittest.main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment