Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Fri, 05 Jun 2015 10:58:10 +0200
From: Christian Neukirchen <>
To: Rich Felker <>
Subject: Re: Revisiting byte-based C locale

Rich Felker <> writes:

> On Thu, Jun 04, 2015 at 11:00:10PM +0200, Christian Neukirchen wrote:
>> Rich Felker <> writes:
>> > On Thu, May 21, 2015 at 10:22:03PM -0400, Rich Felker wrote:
>> >> Any new opinions on the topic? Or interest in re-emphasizing a
>> >> previously stated opinion? :)
>> >
>> > No new opinions on this? I've tentatively added drafting a new
>> > proposed byte-based C locale patch as a roadmap item for this release
>> > cycle, not necessarily to commit it, but as a way to re-evaluate
>> > whether it's still costly to implement.
>> Will it support regexec on 8-bit binary data?
> Yes, as long as the program has done one of the following:
> - Not called setlocale at all.
> - Called setlocale with an explicit "C" argument or in environment.
> - Called uselocale with a locale_t for "C".

AFAICS it does:

in main:
        (void)setlocale(LC_CTYPE, "");

protected int
file_regcomp(file_regex_t *rx, const char *pat, int flags)
        rx->c_lc_ctype = newlocale(LC_CTYPE_MASK, "C", 0);
        assert(rx->c_lc_ctype != NULL);
        rx->old_lc_ctype = uselocale(rx->c_lc_ctype);
        assert(rx->old_lc_ctype != NULL);
        rx->pat = pat;

        return rx->rc = regcomp(&rx->rx, pat, flags);

>> We found out file(1)
>> needs this.
> Indeed, aside from the Austin Group issue 663, having this topic come
> up several times in real-world usage is the motivation for
> reconsidering it. I believe file(1) _attempts_ to do this right,
> making use of uselocale.

A strong +1 from me then.  I'll be glad to help testing it on Void Linux.

Christian Neukirchen  <>

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.