Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Jul 2014 17:40:29 -0400
From:      Phil Shafer <phil@juniper.net>
To:        John-Mark Gurney <jmg@funkthat.com>
Cc:        sjg@freebsd.org, arch@freebsd.org, marcel@freebsd.org
Subject:   Re: XML Output: libxo - provide single API to output TXT, XML, JSON and HTML
Message-ID:  <201407312140.s6VLeTS4097915@idle.juniper.net>
In-Reply-To: <20140731210937.GV43962@funkthat.com>

next in thread | previous in thread | raw e-mail | index | archive | help
John-Mark Gurney writes:
>Well, from my understanding there can't be a "locale" that is UTF-8
>as a locale contains more than just character encoding...  It also
>includes month/day names, sorting, etc...  I think you can get a
>C locale (the default) w/ UTF-8 by setting the correct environment
>variables, but I don't know them well enough to say...  Should we add
>a locale that does this?  There is UTF-8 in /usr/share/locale, but if
>you set LANG to it, things don't work..

I'll change the library to follow the settings of the user's env var
and assuming they've set it correctly, all will work well.  Since
libxo uses vsnprintf under the covers, all this should work fine.

    (void)wcsftime(buf, sizeof(buf), fmt, &tp);
    ...
    xo_emit("{:login-time/%ls}", buf);

Or something like that......

Thanks,
 Phil



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201407312140.s6VLeTS4097915>