I'm running some Kotlin code from a test using Gra...
# community-support
g
I'm running some Kotlin code from a test using Gradle. This jvm code calls native code underneath using the last FFM Api in jdk 22 but
atof
will parse
2.2598258677677969
as
2
because on my system
localeconv()->decimal_point
is indeed
,
. Is there a way this might be connected to Gradle and/or some of its settings about the Locale used from there?
more here
e
you can configure the test task to set a particular environment variable
Copy code
tasks.test {
    environment("LC_ALL", "C")
}
but in general this is not a Gradle issue and you should just avoid any use of locale-aware POSIX functions or code using them, they simply don't work even for native code (e.g. https://github.com/mpv-player/mpv/commit/1e70e82baa9193f6f027338b0fab0f5078971fbehttps://github.com/mpv-player/mpv/commit/1e70e82baa9193f6f027338b0fab0f5078971fbe)
👍 1