Add PyInterpreterState.fs_codec.utf8 (GH-18367)

Add a fast-path for UTF-8 encoding in PyUnicode_EncodeFSDefault()
and PyUnicode_DecodeFSDefaultAndSize().

Add _PyUnicode_FiniEncodings() helper function for _PyUnicode_Fini().
This commit is contained in:
Victor Stinner 2020-02-05 17:39:57 +01:00 committed by GitHub
parent 0e4e735d06
commit bf305cc6f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 55 additions and 53 deletions

View file

@ -102,6 +102,7 @@ struct _is {
Later, it is set to a non-NULL string by _PyUnicode_InitEncodings(). */
struct {
char *encoding; /* Filesystem encoding (encoded to UTF-8) */
int utf8; /* encoding=="utf-8"? */
char *errors; /* Filesystem errors (encoded to UTF-8) */
_Py_error_handler error_handler;
} fs_codec;