Re: Preventing control characters from entering an XML file

2006-01-05 Thread Scott David Daniels
Frank Niessink wrote: > Scott David Daniels wrote: >> Frank Niessink wrote: >>> - What is the easiest/most pythonic (preferably build-in) way of >>> checking a unicode string for control characters and weeding those >>> characters out? >> drop_controls = [None] * 0x20 >> for c in '\t\r\

Re: Preventing control characters from entering an XML file

2006-01-05 Thread Frank Niessink
Scott David Daniels wrote: > Frank Niessink wrote: > >>- What is the easiest/most pythonic (preferably build-in) way of >>checking a unicode string for control characters and weeding those >>characters out? > > > drop_controls = [None] * 0x20 > for c in '\t\r\n': > drop_cont

Re: Preventing control characters from entering an XML file

2006-01-01 Thread Scott David Daniels
Frank Niessink wrote: > ... > Character Range > Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | > [#x1-#x10]" > > - What is the easiest/most pythonic (preferably build-in) way of > checking a unicode string for control characters and weeding those > characters out? dr