Problems with Locale

Giuseppe Barbieri elect86 at gmail.com
Sun Jul 7 10:45:38 UTC 2024


Hi folks,


I've been having some issue with the Locale

I've been playing with FFM in Jdk 22 to call native methods in Laamps
<https://github.com/mala-project/lammps/tree/mala>, but long short story:
atof will parse 2.2598258677677969 as 2 because on my system
localeconv()->decimal_point is indeed a comma

The curious thing is that if I try to:

auto name = std::locale::global(std::locale("en_DK.utf8")).name();
utils::logmesg(lmp, "old locale {}\n", name);

I get

old locale C

which, if I understood it right, it's how it should be, but the text
parsing fails nonetheless

unfortunately native code isn't my field, so I'm asking for help


Thanks in advance,
Giuseppe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/panama-dev/attachments/20240707/8ab03054/attachment.htm>


More information about the panama-dev mailing list