[issue1767933] Badly formed XML using etree and utf-16

2010-07-26 Thread Richard Urwin
Richard Urwin added the comment: As an example, here is the first two lines of output when I use Python 2.6.3: 60 63 120 109 108 32 118 101 114 115 105 111 110 61 39 49 46 48 39 32 101 110 99 111 100 105 110 103 61 39 85 84 70 45 49 54 39 63 62 10 60 255 254 104 0 116 0 109 0 108 0 62 255 254

[issue1767933] Badly formed XML using etree and utf-16

2010-07-26 Thread Richard Urwin
Richard Urwin added the comment: > Execute bug-test.xml I meant bug-test.py, of course -- ___ Python tracker <http://bugs.python.org/issue1767933> ___ ___ Py

[issue1767933] Badly formed XML using etree and utf-16

2010-07-26 Thread Richard Urwin
Richard Urwin added the comment: I can't produce an automated test, for want of time, but here is a demonstrator. Grab the example XHTML from http://docs.python.org/library/xml.etree.elementtree.html#elementtree-objects or use some tiny ASCII-encoded xml file. Save it as "file.x

[issue1767933] Badly formed XML using etree and utf-16

2008-11-14 Thread Richard urwin
Richard urwin <[EMAIL PROTECTED]> added the comment: Here is a patch of my quick hack, more for interest than any suggestion it gets used. Although it does produce good output so long as you avoid the BOM. The full solution is beyond my (very weak) Python skills. The character encoding i

[issue1767933] Badly formed XML using etree and utf-16

2008-11-14 Thread Richard urwin
Richard urwin <[EMAIL PROTECTED]> added the comment: This is a bug in two halves. 1. Not all characters in the file are UTF-16. The initial xml header isn't, and the individual < > etc characters are not. This is just a matter of extending the methodology to encode all charac