# HG changeset patch # User Paul Boddie # Date 1481503588 -3600 # Node ID 42fed2e5be00f31df56c10faaac78f2eebde4ba7 # Parent f4c762e01b82b18ba47830b0154b2a8aff2f688b Put exception handling around all conversions. diff -r f4c762e01b82 -r 42fed2e5be00 tests/iconv.py --- a/tests/iconv.py Mon Dec 12 01:12:52 2016 +0100 +++ b/tests/iconv.py Mon Dec 12 01:46:28 2016 +0100 @@ -8,14 +8,14 @@ from_utf16 = Converter("UTF-16", "ISO-8859-1") try: - iso = "æøå" - print iso # æøå - utf = to_utf8.convert(iso) - print utf # æøå - print from_utf8.convert(utf) # æøå - utf = to_utf16.convert(iso) - print utf # ... try: + iso = "æøå" + print iso # æøå + utf = to_utf8.convert(iso) + print utf # æøå + print from_utf8.convert(utf) # æøå + utf = to_utf16.convert(iso) + print utf # ... print from_utf16.convert(utf) # æøå except OSError, exc: if exc.value == EINVAL: