summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2019-05-02 15:28:57 (GMT)
committerGitHub <noreply@github.com>2019-05-02 15:28:57 (GMT)
commite251095a3f4778102f554cecffcfd837f4d1db6c (patch)
tree050ebaae241e689f989f42cf3d8bbe23d6f9258b /Include
parentc4e78b116f9a4299f3b3bfbbd18ef49782bb1143 (diff)
downloadcpython-e251095a3f4778102f554cecffcfd837f4d1db6c.zip
cpython-e251095a3f4778102f554cecffcfd837f4d1db6c.tar.gz
cpython-e251095a3f4778102f554cecffcfd837f4d1db6c.tar.bz2
bpo-36775: Add _Py_FORCE_UTF8_FS_ENCODING macro (GH-13056)
Add _Py_FORCE_UTF8_LOCALE and _Py_FORCE_UTF8_FS_ENCODING macros to avoid factorize "#if defined(__ANDROID__) || defined(__VXWORKS__)" and "#if defined(__APPLE__)". Cleanup also config_init_fs_encoding().
Diffstat (limited to 'Include')
-rw-r--r--Include/pyport.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/Include/pyport.h b/Include/pyport.h
index 568ab8f..97fb5e5 100644
--- a/Include/pyport.h
+++ b/Include/pyport.h
@@ -819,4 +819,14 @@ extern _invalid_parameter_handler _Py_silent_invalid_parameter_handler;
# error "Py_TRACE_REFS ABI is not compatible with release and debug ABI"
#endif
+#if defined(__ANDROID__) || defined(__VXWORKS__)
+ /* Ignore the locale encoding: force UTF-8 */
+# define _Py_FORCE_UTF8_LOCALE
+#endif
+
+#if defined(_Py_FORCE_UTF8_LOCALE) || defined(__APPLE__)
+ /* Use UTF-8 as filesystem encoding */
+# define _Py_FORCE_UTF8_FS_ENCODING
+#endif
+
#endif /* Py_PYPORT_H */