https://bugs.dragonflybsd.org/
https://bugs.dragonflybsd.org/favicon.ico?1629395208
2014-06-02T22:08:50Z
DragonFlyBSD bugtracker
DragonFlyBSD - Bug #2415: setlocale() for unknown locales
https://bugs.dragonflybsd.org/issues/2415?journal_id=12016
2014-06-02T22:08:50Z
tuxillo
<ul><li><strong>Description</strong> updated (<a title="View differences" href="/journals/12016/diff?detail_id=1721">diff</a>)</li><li><strong>Category</strong> set to <i>Userland</i></li><li><strong>Assignee</strong> set to <i>tuxillo</i></li><li><strong>Target version</strong> set to <i>3.9.x</i></li></ul><p>Hi,</p>
<p>Not sure if I've understood. In the case you pass the "locale" string to setlocale(3):</p>
<p>$ uname -a<br />DragonFly hammer.df.com 3.6-RELEASE DragonFly v3.6.0-RELEASE <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: make upgrade broken (Closed)" href="https://bugs.dragonflybsd.org/issues/8">#8</a>: Fri Nov 22 13:22:00 PST 2013 <a class="email" href="mailto:root@pkgbox64.dragonflybsd.org">root@pkgbox64.dragonflybsd.org</a>:/usr/obj/build/home/justin/src/sys/X86_64_GENERIC x86_64<br />$ ./t_locale<br />setlocale(LC_ALL, "es_ES.UTF-8")=es_ES.UTF-8<br />setlocale(LC_ALL, "en_EN.UTF-8")=(null)<br />setlocale(LC_ALL, "fake")=(null)<br />setlocale(LC_ALL, NULL)=es_ES.UTF-8</p>
<p>$ uname -a<br />DragonFly hammer.df.com 3.7-DEVELOPMENT DragonFly v3.7.1.1227.g566f1-DEVELOPMENT <a class="issue tracker-1 status-5 priority-3 priority-lowest closed" title="Bug: lib/libcr/sys/ cleanup (Closed)" href="https://bugs.dragonflybsd.org/issues/1">#1</a>: Thu May 22 19:25:43 CEST 2014 root@:/usr/obj/usr/src/sys/X86_64_GENERIC x86_64<br />$ ./t_locale1<br />setlocale(LC_ALL, "es_ES.UTF-8")=es_ES.UTF-8<br />setlocale(LC_ALL, "en_EN.UTF-8")=(null)<br />setlocale(LC_ALL, "fake")=(null)<br />setlocale(LC_ALL, NULL)=es_ES.UTF-8</p>
<p>root@testfbsd:/root # uname -a<br />FreeBSD testfbsd 9.1-RELEASE-p10 FreeBSD 9.1-RELEASE-p10 #0: Sun Jan 12 20:11:23 UTC 2014 <a class="email" href="mailto:root@amd64-builder.daemonology.net">root@amd64-builder.daemonology.net</a>:/usr/obj/usr/src/sys/GENERIC amd64<br />root@testfbsd:/root # cc t_locale.c -o t_locale<br />root@testfbsd:/root # ./t_locale<br />setlocale(LC_ALL, "es_ES.UTF-8")=es_ES.UTF-8<br />setlocale(LC_ALL, "en_EN.UTF-8")=(null)<br />setlocale(LC_ALL, "fake")=(null)<br />setlocale(LC_ALL, NULL)=es_ES.UTF-8</p>
<p>In the case of using "" as locale:</p>
<p>DFly:<br />$ ./t_locale1<br />setlocale(LC_ALL, "")=(null)<br />$ echo $LC_ALL<br />fake</p>
<p>FreBSD 9.1:<br />root@testfbsd:/root # ./t_locale<br />setlocale(LC_ALL, "")=(null)<br />root@testfbsd:/root # echo $LC_ALL<br />fake</p>
<p>I hope I'm not misunderstanding what you just said.</p>
<p>Best regards,<br />Antonio Huete</p>
DragonFlyBSD - Bug #2415: setlocale() for unknown locales
https://bugs.dragonflybsd.org/issues/2415?journal_id=12083
2014-06-13T10:05:00Z
meand
bsd@gisladisker.se
<ul></ul><p>Your reading of my message was correct, but with a probability close to certainty<br />this issue was inadvertedly amended in commit 0d5acd74 by John Marino, whose commit<br />touched also the file "lib/libc/locale/setlocale.c".</p>
<p>For reference, the behaviour of 3.4 and 3.9:</p>
<p>$ uname -v<br />DragonFly v3.9.0.33.g96b40-DEVELOPMENT ...</p>
<p>setlocale(LC_ALL, "fake") = NULL</p>
<p>and identically for LC_COLLATE, LC_CTYPE, LC_MESSAGES, LC_MONETARY,<br />LC_NUMERIC and LC_TIME.</p>
<p>$ uname -v<br />DragonFly v3.4.3-RELEASE ...</p>
<p>setlocale(LC_ALL, "fake") = "C/C/fake/fake/fake/C"</p>
<p>setlocale(LC_MONETARY, "fake") = "fake" <br />setlocale(LC_NUMERIC, "fake") = "fake" <br />setlocale(LC_TIME, "fake") = "fake"</p>
<p>but the correct value NULL is passed for LC_COLLATE, LC_CTYPE, LC_MESSAGES.</p>
<p>I must conclude that the issue <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: setlocale() for unknown locales (Closed)" href="https://bugs.dragonflybsd.org/issues/2415">#2415</a> can be closed for the current<br />development branch.</p>
<p>Best regards,<br /> Mats Erik Andersson</p>
DragonFlyBSD - Bug #2415: setlocale() for unknown locales
https://bugs.dragonflybsd.org/issues/2415?journal_id=12084
2014-06-13T10:13:45Z
tuxillo
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Closed</i></li></ul><p>Confirmed as fixed.</p>