bpo-31904: Add encoding support for VxWorks RTOS (GH-12051)

Use UTF-8 as the system encoding on VxWorks.

The main reason are:

1. The locale is frequently misconfigured.
2. Missing some functions to deal with locale in VxWorks C library.
This commit is contained in:
pxinwr 2019-03-04 17:02:06 +08:00 committed by Victor Stinner
parent 8bc401a55c
commit f4b0a1c0da
7 changed files with 19 additions and 14 deletions

View file

@ -760,8 +760,8 @@ system.
Py_ssize_t len, \
const char *errors)
Decode a string from UTF-8 on Android, or from the current locale encoding
on other platforms. The supported
Decode a string from UTF-8 on Android and VxWorks, or from the current
locale encoding on other platforms. The supported
error handlers are ``"strict"`` and ``"surrogateescape"``
(:pep:`383`). The decoder uses ``"strict"`` error handler if
*errors* is ``NULL``. *str* must end with a null character but
@ -796,8 +796,8 @@ system.
.. c:function:: PyObject* PyUnicode_EncodeLocale(PyObject *unicode, const char *errors)
Encode a Unicode object to UTF-8 on Android, or to the current locale
encoding on other platforms. The
Encode a Unicode object to UTF-8 on Android and VxWorks, or to the current
locale encoding on other platforms. The
supported error handlers are ``"strict"`` and ``"surrogateescape"``
(:pep:`383`). The encoder uses ``"strict"`` error handler if
*errors* is ``NULL``. Return a :class:`bytes` object. *unicode* cannot