On Wed, Jan 18, 2006 at 11:17:30AM -0800, Garrett Rooney wrote:
> Is there any particular reason that httpd never does the
> 'setlocale(LC_ALL, "");' magic necessary to get libc to respect the
> various locale related environment variables?  As far as I can tell,
> despite system settings for locale (i.e. /etc/sysconfig/i18n on RHEL)
> httpd always runs with a locale of C, which is fine for most things,
> but pretty irritating if you have a need to do stuff with multibyte
> strings in a module.
> 
> Just adding a call to setlocale with a "" locale in httpd's main makes
> my particular problem go away, but I'm kind of hesitant to propose
> actually doing so since I don't know what kind of fallout there would
> be from having httpd all of a sudden start respecting the environment
> variables...

Ideally the locale shouldn't matter, but in practice it does: notably 
strcasecmp() and the is* functions behave differently.  This can cause 
things to fail in surprising ways, so it's generally to be avoided.

Various modules will do it at startup anyway, so it's hard to avoid 
completely, but it's not something that I'd really advise propagating.

joe


Reply via email to