encodings.normalize_encoding
Prev: encodings.CodecRegistryError | Up: encodings | Next: encodings.search_function
Rel: encodings.CodecRegistryError, encodings.search_function
Ref: docs.python.org — encodings.normalize_encoding
Tags: #public #python3 #stdlib #encodings
Import
import encodings
from encodings import normalize_encoding
Signature & Overview
encodings.normalize_encoding(encoding)
Normalize an encoding name.
Usage
import encodings
assert encodings.normalize_encoding("UTF-8") == "utf_8"
assert encodings.normalize_encoding("iso-8859-1") == "iso_8859_1"
Gotchas
- Maps encoding names to valid Python module names under
encodings.
REPL Inspect
from encodings import normalize_encoding
help(normalize_encoding)
Linked from
Related notes
- tuts/python3/stdlib_module/encodings/CodecRegistryError Linked here; links to this page; shared tags: #encodings, #stdlib
- tuts/python3/stdlib_module/encodings/search_function Linked here; links to this page; shared tags: #encodings, #stdlib
- tuts/python3/stdlib_module/encodings Linked here; links to this page; shared tags: #stdlib
- tuts/c/stdlib shared tags: #stdlib
- tuts/c/stdlib/assert shared tags: #stdlib
- tuts/c/stdlib/assert/assert shared tags: #stdlib
- tuts/c/stdlib/assert/static_assert shared tags: #stdlib
- tuts/c/stdlib/ctype shared tags: #stdlib
- tuts/c/stdlib/ctype/isalpha shared tags: #stdlib
- tuts/c/stdlib/ctype/isdigit shared tags: #stdlib