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
VERSION: quickjs 2021-03-27
OS: Win11-21H2-ZHCN and Win10-21H2-RUSSIAN
I use quickjs to run javascript in my program, but my user report a problem.
When I change the number point as comma, quickjs can't parse and stringify float correctly, but in some countries(like russia),the default number point of windows PC is comma.
for example:
I found the reason on "quickjs.c"
"strtod" will called on "js_strtod", "snprintf" will called on "js_fcvt1", when parse or stringify a Number object, js_strtod and js_fcvt1 will be called. , strtod and snprintf will use comma be a number point when system number point is comma
I hope this bug can be fixed
The text was updated successfully, but these errors were encountered:
twinstar6980
changed the title
A bug of number parse and stringify whenlocale settings is special
A bug of number parse and stringify when locale settings is special
Jan 12, 2022
This is not mentioned in the documentation, and even if it were, this is a very silly design decision to make. Locales are a perfectly legitimate feature of the C standard, relied on by many desktop applications, some of which may even not be directly written in C. This issue would be very easy to trigger when QuickJS is embedded as a scripting engine in another program.
VERSION: quickjs 2021-03-27
OS: Win11-21H2-ZHCN and Win10-21H2-RUSSIAN
I use quickjs to run javascript in my program, but my user report a problem.
When I change the number point as comma, quickjs can't parse and stringify float correctly, but in some countries(like russia),the default number point of windows PC is comma.
for example:
I found the reason on "quickjs.c"
"strtod" will called on "js_strtod", "snprintf" will called on "js_fcvt1", when parse or stringify a Number object, js_strtod and js_fcvt1 will be called. , strtod and snprintf will use comma be a number point when system number point is comma
I hope this bug can be fixed
The text was updated successfully, but these errors were encountered: