On 1/18/06, Joe Orton <[EMAIL PROTECTED]> wrote:
> 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.

The specific problem I'm trying to fix is that mod_dav_svn fails to
run a pre-lock hook script when you try to lock a filename with double
byte characters.  It never even gets to the point of trying to run the
script, it fails trying to build the command line because it can't
convert the filename from utf8 to the native encoding because the
locale is C and thus the native encoding is 7 bit ascii.  I'm having
trouble finding a work around for this that doesn't involve setting
the locale, although if there's anything obvious I'm missing I'd love
to hear it.

-garrett

Reply via email to