From aea2eb6d7050eeaff8cd1b289eeeae86d3372863 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Wed, 6 Aug 2025 13:02:42 +0800 Subject: [PATCH] Ensure that locale is set on startup. --- {{ cookiecutter.format }}/{{ cookiecutter.class_name }}/main.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/{{ cookiecutter.format }}/{{ cookiecutter.class_name }}/main.m b/{{ cookiecutter.format }}/{{ cookiecutter.class_name }}/main.m index c9039c3..7496322 100644 --- a/{{ cookiecutter.format }}/{{ cookiecutter.class_name }}/main.m +++ b/{{ cookiecutter.format }}/{{ cookiecutter.class_name }}/main.m @@ -70,6 +70,8 @@ int main(int argc, char *argv[]) { // Enforce UTF-8 encoding for stderr, stdout, file-system encoding and locale. // See https://docs.python.org/3/library/os.html#python-utf-8-mode. preconfig.utf8_mode = 1; + // Ensure the locale is set (isolated interpreters won't by default) + preconfig.configure_locale = 1; // Don't buffer stdio. We want output to appears in the log immediately config.buffered_stdio = 0; // Don't write bytecode; we can't modify the app bundle