Note: file system encoding cannot be None anymore (since r81190, issue #8610).
.. data:: ENCODING
- The default character encoding i.e. the value from either
- :func:`sys.getfilesystemencoding` or :func:`sys.getdefaultencoding`.
+ The default character encoding: ``'utf-8'`` on Windows,
+ :func:`sys.getfilesystemencoding` otherwise.
.. seealso::
#---------------------------------------------------------
# initialization
#---------------------------------------------------------
-ENCODING = sys.getfilesystemencoding()
-if ENCODING is None:
- ENCODING = "ascii"
+if os.name in ("nt", "ce"):
+ ENCODING = "utf-8"
+else:
+ ENCODING = sys.getfilesystemencoding()
#---------------------------------------------------------
# Some useful functions
Library
-------
+- Issue #8784: Set tarfile default encoding to 'utf-8' on Windows.
+
- Issue #8966: If a ctypes structure field is an array of c_char, convert its
value to bytes instead of str (as done for c_char and c_char_p).