mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-36775: _PyCoreConfig only uses wchar_t* (GH-13062)
_PyCoreConfig: Change filesystem_encoding, filesystem_errors, stdio_encoding and stdio_errors fields type from char* to wchar_t*. Changes: * PyInterpreterState: replace fscodec_initialized (int) with fs_codec structure. * Add get_error_handler_wide() and unicode_encode_utf8() helper functions. * Add error_handler parameter to unicode_encode_locale() and unicode_decode_locale(). * Remove _PyCoreConfig_SetString(). * Rename _PyCoreConfig_SetWideString() to _PyCoreConfig_SetString(). * Rename _PyCoreConfig_SetWideStringFromString() to _PyCoreConfig_DecodeLocale().
This commit is contained in:
parent
6ae2bbbdfc
commit
709d23dee6
11 changed files with 357 additions and 220 deletions
|
@ -260,6 +260,7 @@ Py_LOCAL_INLINE(PyObject *)
|
|||
STRINGLIB(utf8_encoder)(PyObject *unicode,
|
||||
STRINGLIB_CHAR *data,
|
||||
Py_ssize_t size,
|
||||
_Py_error_handler error_handler,
|
||||
const char *errors)
|
||||
{
|
||||
Py_ssize_t i; /* index into data of next input character */
|
||||
|
@ -268,7 +269,6 @@ STRINGLIB(utf8_encoder)(PyObject *unicode,
|
|||
PyObject *error_handler_obj = NULL;
|
||||
PyObject *exc = NULL;
|
||||
PyObject *rep = NULL;
|
||||
_Py_error_handler error_handler = _Py_ERROR_UNKNOWN;
|
||||
#endif
|
||||
#if STRINGLIB_SIZEOF_CHAR == 1
|
||||
const Py_ssize_t max_char_size = 2;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue