Encoding Modules

encodings.mbcs

Windows-specific codec that uses the active ANSI code page (CP_ACP). Results for non-ASCII text depend on system configuration; choose UTF-8 for portable text when the protocol permits. The example uses ASCII only. This module is unavailable on the local non-Windows build; the example is proposed for a Windows runtime.

Formal Syntax & Structure

python syntaxpython
import encodings.mbcs

Return Value

module

Module namespace available through import; import is a statement, not a value-returning expression.

Working Example

Example Snippetpython
import encodings.mbcsprint("Tea".encode("mbcs").decode("mbcs"))
Python Reference