def get_encoding_name(self, encoding):
encoding = CodePages.get_encoding_name(encoding)<EOL>if encoding not in self.codepages:<EOL><INDENT>raise ValueError((<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>).format(encoding, '<STR_LIT:U+002C>'.join(self.codepages.keys())))<EOL><DEDENT>return encoding<EOL>
Given an encoding provided by the user, will return a
        canonical encoding name; and also validate that the encoding
        is supported.

        TODO: Support encoding aliases: pc437 instead of cp437.