httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael B Allen <>
Subject Re: i18n support
Date Mon, 26 Mar 2007 19:50:05 GMT
On Mon, 26 Mar 2007 20:27:17 +0100
Joe Orton <> wrote:

> On Mon, Mar 26, 2007 at 02:26:28PM -0400, Michael B Allen wrote:
> > However, from searching the archives I recall some comments that it was
> > perhaps inappropriate to use anything but the C locale because globally
> > changing the locale might yield non-determinisitic behavior. Is that
> > true? Or is it perfectly save for someone to run in de_DE.ISO-8859-1
> > for example?
> There are a couple of issues here:
> 1) if your module is used in a thread-based server, changing the 
> (process global) locale from one thread will affect all the threads in 
> the process
> 2) there are some places in httpd which use locale-specific string 
> comparisons against strings coming from the user and network.  Changing 
> the locale can have "interesting" effects on those comparisons, 
> depending on the specific locale used.  (the Turkish locale is a nice 
> example, where "i" and "I" don't compare as case-insensitive equals)
> So yes, the general recommendation to not change the locale is a good 
> one.  A library which only works in a *specific* locale is rather 
> awkward.

Ok. Yeah, that's what I thought you were going to say. We're going
to change our code to use custom localization functions. It is very
unfortunate that the multibyte functions (e.g. mbtowc) are poorly designed
such that they cannot accept a context to hold locale state.


View raw message