Change the way to generate encoding_map