Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20140702171809.GA1611@brightrain.aerifal.cx>
Date: Wed, 2 Jul 2014 13:18:09 -0400
From: Rich Felker <dalias@...c.org>
To: musl@...ts.openwall.com
Subject: Locale framework, part 1

Despite it being a good bit more work, I've taken the time to factor
the locale changes into two parts to make it more clear what's going
on. I plan to commit this very soon, with possible changes after it's
committed, but I'm posting it here for some immediate discussion
taking place on IRC.

Part 1 adds the framework for setlocale: a real locale data structure,
an operation to change the individual category settings, tracking the
active locale per thread, etc. It also has tracking, as described in
the previous thread, of byte-based versus utf8-based status, but this
status is not used anywhere. So, while separate "C" and "C.UTF-8"
locale states exist after part 1 is applied, they both still have
nl_langinfo(CODESET) being "UTF-8".

Part 2 will add the actual functionality for byte-based C locale,
which requires trivial changes in the existing multibyte functions
which operate based on the current locale, and moderately invasive
changes in the wide stdio functions which have to bind to the locale
that was in effect when the stream became wide-oriented.

Part 3 has not yet been started, and will add actual positive features
related to the locale setting, such as tiny working catgets/gettext,
locale-based time formatting, etc. If I'm not mistaken, this can all
be implemented on top of .mo files and a trivial gettext lookup
function (e.g. LC_TIME can be gettext lookups for the corresponding
C-locale time-formatting string) or catgets (using the nl_langinfo
item indexes at integer catgets keys rather than string-based keys).
This will probably be a project for a subsequent release cycle, as
some more discussion should go into design before it happens.

Attached is part 1.

Rich

View attachment "locale_part1.diff" of type "text/plain" (10921 bytes)

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.