58
58
# in overall time. But if you miss frequently, then if None is much
59
59
# faster. For our use case, we *rarely* have a revision id, file id
60
60
# or path name that is unicode. So use try/KeyError.
67
64
_unicode_to_escaped_map = {}
70
68
"""Encode the string into utf8, and escape invalid XML characters"""
71
69
# We frequently get entities we have not seen before, so it is better
72
70
# to check if None, rather than try/KeyError