def make_encoding_map(decoding_map):
m = {}<EOL>for k,v in list(decoding_map.items()):<EOL><INDENT>if not v in m:<EOL><INDENT>m[v] = k<EOL><DEDENT>else:<EOL><INDENT>m[v] = None<EOL><DEDENT><DEDENT>return m<EOL>
Creates an encoding map from a decoding map.

        If a target mapping in the decoding map occurs multiple
        times, then that target is mapped to None (undefined mapping),
        causing an exception when encountered by the charmap codec
        during translation.

        One example where this happens is cp875.py which decodes
        multiple character to \\u001a.