You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FIXED: #1093 PL_initialise() no longer mutates the process LC_NUMERIC locale
initLocale() used to call setlocale(LC_NUMERIC, "") to bootstrap the
default PL_locale from localeconv(). As a side effect it changed the
embedder's process-wide decimal separator, breaking atof() and
printf("%f") in host code that expects the C locale. Read the
environment's numeric conventions via newlocale()/uselocale() (POSIX
2008) instead, with a save/setlocale/restore fallback under L_LOCALE
for platforms without them. locale_create/3 uses the same helper.
Also fix a latent bug in update_locale() that only surfaced with the
above change: Prolog setlocale/3 for unrelated categories (notably
LC_MESSAGES from os_user_lang/1 during boot) was unconditionally
re-reading localeconv() and clobbering the decimal_point picked up at
init time. Gate the refresh on LC_NUMERIC / LC_ALL.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments