[issue35613] Escaping string containing invalid characters as per XML

2018-12-29 Thread Ned Deily
Ned Deily added the comment: This question has come up before. See Issue13648 where it was pointed out that null characters "are forbidden both in raw form *and* in escaped form. So even if they get escaped, they *still* will lead to errors. So there is no point in escaping them."

[issue35613] Escaping string containing invalid characters as per XML

2018-12-29 Thread Devika Sondhi
New submission from Devika Sondhi : As per XML 1.0 and 1.1 specs, the null character is treated as invalid in an XML doc. (https://en.wikipedia.org/wiki/Valid_characters_in_XML) Shouldn't invalid xml characters be omitted while escaping? The current behavior(tested on Python 3.7) is as follows: