Victor Stinner
d19febb00c
Rework locale encoding C functions ( #158680 )
...
Add output_length to _Py_EncodeLocale(), _Py_EncodeUTF8(),
encode_current_locale() and encode_ascii(). So unicode_encode_locale() and
wstr_to_utf8() can now use the output_length, instead of having to compute
strlen().
* Rename functions:
* _Py_DecodeUTF8Ex() => _Py_DecodeUTF8()
* _Py_EncodeUTF8Ex() => _Py_EncodeUTF8()
* _Py_EncodeLocaleEx() => _Py_EncodeLocale()
* _Py_DecodeLocaleEx() => _Py_DecodeLocale()
* Add tests on Py_DecodeLocale() and Py_EncodeLocale() in test_codecs.
Clarify also their documentation.
* _Py_EncodeLocale() and _Py_DecodeLocale() now sets all output parameters on
error. Add more tests on these output parameters.
* Add encode_current_locale_impl() to simplify encode_current_locale().
* Remove reason parameter of _Py_EncodeLocale() and _Py_DecodeLocale() to
simplify the code. Only the UTF-8 decoder used specific reasons.
* _Py_EncodeUTF8() now uses size_t instead of Py_ssize_t to iterate
on the input string.
* On error, encode_current_locale_impl() now returns ENCODE_ERROR (new
constant) instead of DECODE_ERROR.
* Mark _Py_EncodeLocaleRaw() as static (it's not used outside fileutils.c).
2026-10-04 23:22:18 +02:00
..
2026-10-01 16:20:45 +00:00
2022-10-17 12:01:00 +02:00
2026-03-24 17:47:55 +00:00
2026-08-21 10:03:51 +01:00
2021-03-23 20:47:40 +01:00
2026-05-23 08:03:52 -04:00
2026-05-23 08:03:52 -04:00
2026-05-23 08:03:52 -04:00
2026-09-29 10:48:11 +00:00
2026-09-23 19:56:53 -07:00
2026-03-09 10:37:23 -07:00
2026-09-23 19:56:53 -07:00
2026-09-27 19:00:22 +03:00
2026-09-10 22:58:27 +02:00
2026-09-23 22:08:56 +05:30
2026-10-01 16:20:45 +00:00
2026-09-24 10:47:59 +02:00
2026-08-13 00:12:39 +00:00
2026-10-01 16:20:45 +00:00
2026-04-22 09:08:23 +01:00
2026-09-01 15:29:26 +02:00
2026-09-26 13:00:10 -07:00
2026-09-23 20:31:57 +01:00
2024-02-02 13:50:51 +00:00
2024-04-02 20:35:52 +00:00
2026-08-15 11:00:03 +05:30
2026-06-16 16:56:37 +00:00
2026-04-01 18:34:55 +02:00
2025-06-13 16:45:21 -06:00
2026-06-23 16:31:47 -04:00
2026-09-30 05:22:37 +00:00
2023-09-02 16:50:18 +02:00
2017-12-12 13:55:04 +02:00
2023-10-04 22:50:29 +00:00
2026-07-27 15:05:40 +02:00
2023-10-04 22:50:29 +00:00
2026-09-11 15:35:34 +02:00
2023-09-08 17:54:45 +01:00
2026-09-08 15:26:48 +08:00
2025-09-17 15:33:55 +01:00
2026-09-11 09:22:36 +08:00
2026-10-02 16:22:05 -04:00
2026-10-01 16:20:45 +00:00
2026-10-04 23:22:18 +02:00
2026-08-16 15:38:53 +03:00
2026-09-02 23:26:04 +05:30
2026-09-16 18:58:59 +05:30
2025-08-06 14:33:28 +02:00
2026-09-24 16:29:48 +00:00
2026-10-03 11:36:01 -07:00
2024-07-22 12:08:27 -04:00
2026-06-05 13:43:05 +00:00
2026-10-01 16:20:45 +00:00
2026-03-31 10:59:17 +03:00
2026-10-03 15:15:08 +02:00
2024-11-12 15:59:19 +02:00
2026-10-03 15:37:58 +02:00
2017-11-28 17:56:10 +02:00
2026-10-03 15:15:08 +02:00
2026-09-27 19:00:22 +03:00
2023-12-06 15:09:22 +01:00
2026-10-02 19:20:04 +02:00
2025-11-26 14:12:49 +01:00
2025-05-25 20:19:29 +00:00
2026-10-04 23:22:18 +02:00
2026-01-16 09:11:58 +00:00
2026-08-07 11:34:10 -04:00
2026-03-31 10:59:17 +03:00
2026-09-26 13:00:10 -07:00
2026-05-05 09:29:07 +01:00
2026-05-12 15:42:44 +00:00
2026-06-01 17:56:16 +01:00
2026-04-10 17:58:17 +05:30
2026-09-27 17:29:07 +00:00
2026-09-18 17:14:25 +00:00
2026-04-02 13:54:21 +02:00
2022-10-07 11:49:53 -07:00
2023-09-03 18:54:27 +02:00
2024-07-22 12:08:27 -04:00
2026-07-06 10:41:47 +01:00
2026-09-30 14:37:24 +01:00
2026-10-01 12:15:51 +01:00
2026-10-01 16:20:45 +00:00
2026-10-01 12:15:51 +01:00
2026-07-22 10:17:47 +01:00
2026-04-22 14:31:19 -04:00
2026-09-24 12:52:54 +02:00
2026-09-18 17:04:21 -04:00
2026-09-18 17:04:21 -04:00
2026-10-01 14:58:55 +00:00
2024-11-07 16:37:41 +01:00
2022-01-13 09:46:04 +01:00
2026-02-21 12:42:13 +01:00
2026-10-03 15:15:08 +02:00
2021-10-15 19:45:34 +02:00
2026-10-01 16:20:45 +00:00
2026-07-21 14:11:22 +05:30
2023-09-01 18:36:53 +02:00
2026-09-18 14:09:09 +02:00
2026-09-30 05:22:37 +00:00
2026-09-24 15:06:56 +09:00
2026-09-12 14:30:00 +01:00
2026-07-10 03:36:31 +02:00
2026-07-06 16:50:15 +02:00
2026-02-17 11:12:25 -05:00
2014-07-25 21:52:14 +10:00
2026-05-21 17:06:52 +01:00
2026-09-19 16:11:49 +00:00
2025-12-06 22:37:34 +00:00
2026-05-05 09:18:04 +02:00
2026-05-05 09:18:04 +02:00
2026-05-05 09:18:04 +02:00
2026-09-30 14:37:24 +01:00
2025-11-05 11:12:56 -08:00
2026-09-16 18:58:59 +05:30
2026-05-06 09:50:24 -04:00
2025-03-17 09:19:04 +00:00
2026-09-23 20:31:57 +01:00
2026-09-27 19:00:22 +03:00
2026-07-25 00:33:29 +02:00
2024-10-13 20:59:41 +05:30
2026-09-17 16:34:50 +02:00
2025-11-06 16:10:39 +01:00
2024-03-13 23:53:32 +01:00
2026-09-19 18:48:39 +03:00
2026-08-30 13:04:55 +05:30
2026-07-21 14:11:22 +05:30
2025-01-17 16:42:27 +01:00
2025-04-29 12:56:20 +02:00