Victor Stinner
d929f1838a
bpo-36443: Disable C locale coercion and UTF-8 Mode by default (GH-12589)
...
bpo-36443, bpo-36202: Since Python 3.7.0, calling Py_DecodeLocale()
before Py_Initialize() produces mojibake if the LC_CTYPE locale is
coerced and/or if the UTF-8 Mode is enabled by the user
configuration. This change fix the issue by disabling LC_CTYPE
coercion and UTF-8 Mode by default. They must now be enabled
explicitly (opt-in) using the new _Py_PreInitialize() API with
_PyPreConfig.
When embedding Python, set coerce_c_locale and utf8_mode attributes
of _PyPreConfig to -1 to enable automatically these parameters
depending on the LC_CTYPE locale, environment variables and command
line arguments
Alternative: Setting Py_UTF8Mode to 1 always explicitly enables the
UTF-8 Mode.
Changes:
* _PyPreConfig_INIT now sets coerce_c_locale and utf8_mode to 0 by
default.
* _Py_InitializeFromArgs() and _Py_InitializeFromWideArgs() can now
be called with config=NULL.
2019-03-27 18:28:46 +01:00
..
2019-03-14 10:32:22 +02:00
2019-03-25 10:07:47 +02:00
2018-11-27 13:27:31 +02:00
2019-03-14 10:32:22 +02:00
2019-03-14 10:32:22 +02:00
2019-01-02 11:26:57 -08:00
2019-03-19 22:10:18 +09:00
2019-03-14 10:32:22 +02:00
2019-03-18 15:44:11 +09:00
2018-12-10 16:06:18 +01:00
2019-02-24 10:30:14 +09:00
2019-03-22 04:07:32 -07:00
2018-11-27 13:27:31 +02:00
2018-10-31 02:28:07 +02:00
2019-03-18 15:44:11 +09:00
2019-03-13 22:59:55 +02:00
2018-09-21 15:33:56 -04:00
2018-12-30 15:42:32 -08:00
2019-02-25 17:59:46 +02:00
2019-03-27 12:52:18 +01:00
2018-11-27 19:34:35 +02:00
2019-02-04 14:42:04 -05:00
2018-12-12 20:46:55 +08:00
2019-02-25 17:59:46 +02:00
2019-02-08 18:55:02 -08:00
2019-03-20 19:01:55 +09:00
2019-03-06 15:35:35 +01:00
2018-09-28 12:39:43 -07:00
2019-02-25 17:59:46 +02:00
2019-03-13 22:59:55 +02:00
2018-11-27 13:27:31 +02:00
2019-03-13 22:59:55 +02:00
2018-09-18 09:54:26 +03:00
2019-01-12 08:25:41 +02:00
2019-02-18 15:30:51 +00:00
2018-12-30 18:16:40 -08:00
2018-11-13 12:52:18 +01:00
2019-02-13 23:43:17 -08:00
2018-09-11 16:14:00 -07:00
2019-03-10 12:29:14 +02:00
2019-03-13 22:59:55 +02:00
2019-02-25 17:59:46 +02:00
2018-11-27 19:34:35 +02:00
2019-03-26 14:35:30 +01:00
2019-02-25 17:59:46 +02:00
2019-02-25 17:59:46 +02:00
2019-03-27 12:52:18 +01:00
2018-11-13 15:14:58 +01:00
2019-02-23 22:08:16 -06:00
2019-03-15 16:35:46 -06:00
2019-03-20 21:49:39 +02:00
2018-11-27 13:27:31 +02:00
2019-03-13 22:59:55 +02:00
2018-11-27 13:27:31 +02:00
2018-11-23 16:46:12 +01:00
2019-02-23 12:02:06 +09:00
2019-03-19 02:58:14 +01:00
2018-12-05 21:10:18 +02:00
2019-03-26 08:05:29 +02:00
2019-03-27 18:28:46 +01:00
2018-11-26 20:21:31 -06:00
2019-03-09 19:18:08 +00:00
2018-10-19 20:42:53 +03:00
2019-03-06 18:08:31 +01:00
2018-11-30 09:40:16 +02:00
2018-10-04 10:42:06 +03:00
2019-02-02 09:16:42 -08:00
2019-03-21 23:33:02 +00:00
2019-03-08 23:44:33 -07:00
2018-12-05 21:10:18 +02:00
2019-02-25 17:59:46 +02:00
2018-12-08 16:16:55 +02:00
2018-09-13 21:57:31 -07:00
2019-02-25 17:59:46 +02:00
2018-11-20 16:20:16 +01:00
2018-10-19 20:42:53 +03:00
2018-10-19 20:42:53 +03:00
2018-10-19 20:42:53 +03:00
2019-03-13 18:18:25 +01:00
2019-03-20 19:02:46 +09:00
2018-09-26 16:47:52 +03:00
2019-02-18 15:26:37 +02:00
2018-10-20 01:46:00 +01:00
2018-11-27 13:27:31 +02:00
2018-10-29 06:55:20 +02:00
2019-02-25 15:56:44 -08:00
2019-03-09 16:25:55 -08:00
2018-11-04 15:58:24 -08:00
2019-03-09 16:25:55 -08:00
2019-02-25 17:59:46 +02:00
2019-02-25 17:59:46 +02:00
2018-11-27 19:34:35 +02:00
2019-02-25 17:57:58 +02:00