It's not exactly the same than encodings.normalize_encoding(): the C function also converts to lowercase.