Problems with Locale

Giuseppe Barbieri elect86 at gmail.com
Mon Jul 8 15:34:10 UTC 2024


Hey Jorn,

yep, thanks again for coming to rescue me :)

Giuseppe

Il giorno lun 8 lug 2024 alle ore 17:23 Jorn Vernee <jorn.vernee at oracle.com>
ha scritto:

> Hey Giuseppe,
>
> I think you are also the person that asked this stack overflow question?
> https://stackoverflow.com/q/78717017
>
> If so, I think your has already been resolved?
>
> Jorn
> On 7-7-2024 12:45, Giuseppe Barbieri wrote:
>
> 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/20240708/c09819e8/attachment.htm>


More information about the panama-dev mailing list