<div dir="ltr"><div><div>Hey Jorn,<br><br></div>yep, thanks again for coming to rescue me :)<br><br></div>Giuseppe<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il giorno lun 8 lug 2024 alle ore 17:23 Jorn Vernee <<a href="mailto:jorn.vernee@oracle.com">jorn.vernee@oracle.com</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><u></u>
<div>
<p>Hey Giuseppe,</p>
<p>I think you are also the person that asked this stack overflow
question? <a href="https://stackoverflow.com/q/78717017" target="_blank">https://stackoverflow.com/q/78717017</a></p>
<p>If so, I think your has already been resolved?</p>
<p>Jorn<br>
</p>
<div>On 7-7-2024 12:45, Giuseppe Barbieri
wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div>
<div>
<div>Hi folks,<br>
<br>
<br>
</div>
I've been having some issue with the Locale<br>
<br>
</div>
I've been playing with FFM in Jdk 22 to call native methods in
<a href="https://github.com/mala-project/lammps/tree/mala" target="_blank">Laamps</a>, but long short story: <code>atof</code>
will parse <code>2.2598258677677969</code> as <code>2</code>
because on my system <code>localeconv()->decimal_point</code>
is indeed a comma<br>
<br>
</div>
The curious thing is that if I try to:<br>
<div style="background-color:rgb(255,255,255);color:rgb(8,8,8)">
<pre style="font-family:"JetBrains Mono",monospace;font-size:9.8pt"><span style="color:rgb(0,51,179)">auto </span><span style="color:rgb(0,0,0)">name </span>= <span style="color:rgb(0,128,128)">std</span>::<span style="color:rgb(0,128,128)">locale</span>::global(<span style="color:rgb(0,128,128)">std</span>::locale(<span style="color:rgb(6,125,23)">"en_DK.utf8"</span>)).name();
<span style="color:rgb(0,128,128)">utils</span>::logmesg(<span style="color:rgb(0,0,0)">lmp</span>, <span style="color:rgb(6,125,23)">"old locale {}</span><span style="color:rgb(0,55,166)">\n</span><span style="color:rgb(6,125,23)">"</span>, <span style="color:rgb(0,0,0)">name</span>);</pre>
</div>
<div>I get <br>
<br>
old locale C<br>
<br>
which, if I understood it right, it's how it should be, but
the text parsing fails nonetheless<br>
<br>
unfortunately native code isn't my field, so I'm asking for
help<br>
<br>
<br>
</div>
<div>Thanks in advance,<br>
</div>
<div>Giuseppe<code><br>
</code></div>
</div>
</blockquote>
</div>
</blockquote></div>