from bionic's xlocale.h:

/**
 * @file xlocale.h
 * @brief `locale_t` definition.
 *
 * Most users will want `<locale.h>` instead. `<xlocale.h>` is used by the C
 * library itself to export the `locale_t` type without exporting the
 * `<locale.h>` functions in other headers that export locale-sensitive
 * functions (such as `<string.h>`).
 */

except macOS insists on keeping newlocale(3) there, despite POSIX.

new patch attached, which moves the #include to portability.h and adds a
comment...



On Sat, Dec 19, 2020 at 2:30 AM Rob Landley <r...@landley.net> wrote:

> On 12/14/20 11:13 PM, enh wrote:
> > On Mon, Dec 14, 2020 at 8:54 PM Rob Landley wrote:
> >
> > >    On 12/14/20 7:33 PM, enh via Toybox wrote:
> > >    > Unfortunately neither "C.UTF-8" nor "UTF-8" works on *both*
> OSes...
> > >
> > >    Tempted to newlocale() and uselocale() to edit utf8 support into
> "C" myself, but
> > >    that's even LESS likely to work on macos, isn't it?
> > >
> > >    Rob
> >> actually, the attached patch (on top of the one you already committed)
> doing
> > exactly that does work for me on macOS. (untested on Linux though!)
>
> What's xlocale.h? It's not in posix and musl hasn't got it.
>
> Rob
>

Attachment: 0001-main.c-construct-a-combination-locale-to-add-UTF-8.patch
Description: Binary data

_______________________________________________
Toybox mailing list
Toybox@lists.landley.net
http://lists.landley.net/listinfo.cgi/toybox-landley.net

Reply via email to