[haiku-bugs] Re: [Haiku] #12303: nl_langinfo(CODESET) seems to always return US-ASCII whatever environment values

  • From: "graemeg" <trac@xxxxxxxxxxxx>
  • Date: Thu, 10 Sep 2015 14:51:06 -0000

#12303: nl_langinfo(CODESET) seems to always return US-ASCII whatever
environment
values
----------------------------+----------------------------
Reporter: oco | Owner: nobody
Type: bug | Status: new
Priority: low | Milestone: Unscheduled
Component: System/POSIX | Version: R1/Development
Resolution: | Keywords:
Blocked By: | Blocking:
Has a Patch: 0 | Platform: All
----------------------------+----------------------------

Comment (by graemeg):

I had a similar problem under FreeBSD 10.1 and my test program - just like
yours - didn't call ''setlocale()'' before calling ''nl_langinfo()''. Here
is the corrected test code - which works now under FreeBSD. Just thought I
would mention it, in case it fixes your issue under Haiku too.

{{{
/* Compile with "gcc48 -W -Wall -o langinfo langinfo_test.c" */
#include <stdio.h>
#include <langinfo.h>
#include <locale.h>

int main()
{
setlocale(LC_ALL,"");
printf("%s\n", nl_langinfo(CODESET));
return 0;
}

}}}

--
Ticket URL: <https://dev.haiku-os.org/ticket/12303#comment:2>
Haiku <https://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: