Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bda0556 commit e99b97eCopy full SHA for e99b97e
1 file changed
Doc/tools/sgmlconv/esistools.py
@@ -35,15 +35,19 @@ def decode(s):
35
36
37
_charmap = {}
38
-for c in map(chr, range(256)):
39
- _charmap[c] = c
+for c in range(128):
+ _charmap[chr(c)] = chr(c)
40
+ _charmap[unichr(c + 128)] = chr(c + 128)
41
_charmap["\n"] = r"\n"
42
_charmap["\\"] = r"\\"
43
del c
44
45
_null_join = ''.join
46
def encode(s):
- return _null_join(map(_charmap.get, s))
47
+ try:
48
+ return _null_join(map(_charmap.get, s))
49
+ except TypeError:
50
+ raise Exception("could not encode %r: %r" % (s, map(_charmap.get, s)))
51
52
53
class ESISReader(xml.sax.xmlreader.XMLReader):
0 commit comments