Collin Funk <[email protected]> writes:

> My intuition is that calling the Core Foundation locale functions will
> cause that environment variable to be set along with creating that file.
>
> Can you share the ./configure options you used? Or did you download
> Coreutils through Homebrew? That would help lead me in the right
> direction, I think.

Actually the environment variable is set in any program that is linked
against Core Foundation. Regardless of whether you call functions from
it or not. See the following test program:

    $ cat main.c 
    #include <stdio.h>
    #include <stdlib.h>
    int
    main (void)
    {
      char *p = getenv ("__CF_USER_TEXT_ENCODING");
      printf ("%s\n", p ? p : "(null)");
      return EXIT_SUCCESS;
    }
    $ ./a.out 
    (null)
    $ cc main.c -Wl,-framework -Wl,CoreFoundation
    $ ./a.out 
    0xF23D:0:0

I believe Core Foundation is needed for our setlocale substitute on
MacOS.

Collin



Reply via email to