summaryrefslogtreecommitdiffstats
path: root/Python/fileutils.c
diff options
context:
space:
mode:
authorpxinwr <peixing.xin@windriver.com>2019-03-04 09:02:06 (GMT)
committerVictor Stinner <vstinner@redhat.com>2019-03-04 09:02:06 (GMT)
commitf4b0a1c0da80318e0a4f4c70d2722f01ce3512dd (patch)
treef10e50c695bdeea8a9aeb06b59ace1d5540af53f /Python/fileutils.c
parent8bc401a55ce5dfcdd225c20786ba8e221a0bf29b (diff)
downloadcpython-f4b0a1c0da80318e0a4f4c70d2722f01ce3512dd.zip
cpython-f4b0a1c0da80318e0a4f4c70d2722f01ce3512dd.tar.gz
cpython-f4b0a1c0da80318e0a4f4c70d2722f01ce3512dd.tar.bz2
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.
Diffstat (limited to 'Python/fileutils.c')
-rw-r--r--Python/fileutils.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Python/fileutils.c b/Python/fileutils.c
index 366bd00..75e015a 100644
--- a/Python/fileutils.c
+++ b/Python/fileutils.c
@@ -536,7 +536,7 @@ _Py_DecodeLocaleEx(const char* arg, wchar_t **wstr, size_t *wlen,
int current_locale, _Py_error_handler errors)
{
if (current_locale) {
-#ifdef __ANDROID__
+#if defined(__ANDROID__) || defined(__VXWORKS__)
return _Py_DecodeUTF8Ex(arg, strlen(arg), wstr, wlen, reason,
errors);
#else
@@ -544,7 +544,7 @@ _Py_DecodeLocaleEx(const char* arg, wchar_t **wstr, size_t *wlen,
#endif
}
-#if defined(__APPLE__) || defined(__ANDROID__)
+#if defined(__APPLE__) || defined(__ANDROID__) || defined(__VXWORKS__)
return _Py_DecodeUTF8Ex(arg, strlen(arg), wstr, wlen, reason,
errors);
#else
@@ -569,7 +569,7 @@ _Py_DecodeLocaleEx(const char* arg, wchar_t **wstr, size_t *wlen,
#endif
return decode_current_locale(arg, wstr, wlen, reason, errors);
-#endif /* __APPLE__ or __ANDROID__ */
+#endif /* __APPLE__ or __ANDROID__ or __VXWORKS__ */
}