| |
108 |
|
| |
109 |
# ======================================================== patch matej
|
| |
110 |
# Protect against crappy output of some unnamed (ehm,
|
| |
111 |
# ehm, jhead) programs.
|
| |
112 |
nonPCData = ''
|
| |
113 |
# These are codes of characters which are not PCDATA
|
| |
114 |
# and so they cannot happen in XML file.
|
| |
115 |
nonPCDataRange = range(0x00,0x08)+[0x0b,0x0c]+range(0x0e,0x19)
|
| |
116 |
# The following ones are stricly speaking not incorrect (and XML parse
|
| |
117 |
# won't choke on them), but they are unprintable control
|
| |
118 |
# characters, so they will probably never happen in
|
| |
119 |
# metadata.
|
| |
120 |
nonPCDataRange += range(0x7f,0x9f)
|
| |
121 |
for i in nonPCDataRange:
|
| |
122 |
nonPCData += chr(i)
|
| |
123 |
allchars = string.maketrans('','')
|
| |
124 |
out = out.translate(allchars,nonPCData)
|
| |
125 |
outerr = outerr.translate(allchars,nonPCData)
|
| |
126 |
# ======================================================== patch matej
|
| |
127 |
|
| |
128 |
|