On Fri, 2007-05-04 at 20:48 +0200, Peter J. Holzer wrote:
> On 2007-05-04 11:48:29 -0400, Guy Hulbert wrote:
> > On Fri, 2007-05-04 at 17:08 +0200, Peter J. Holzer wrote:
> > > So either the locale should be reset at the end of the function to the
> > > original value or it should be set globally.
> > 
> > You suggested unsetting LANG.
> > 
> > That seems to be the same as setting LANG=C.
> 
> Yes, that's the same, by definition.

I wasn't sure.

> 
> I don't understand why you quoted that particular paragraph, though,
> where I did not suggest unsetting LANG. Here I suggested that either:

Sorry.  I just quoted the smallest piece that would remind me of the
context.  I probably snipped too much.  I delete most list mail and
refer the the archives.

You actually said:

        I'll unset LANG and LC_* in the init.d-script for
        now, but such places should probably be identified and fixed
        individually.

http://www.nntp.perl.org/group/perl.qpsmtpd/2007/05/msg6626.html

> 1) LANG should be set globally to a value, so that each method and
>    plugin can assume a specific behaviour (that value should probably be
>    "C" or undef, since any other value isn't portable between systems), 
> 
>    or
> 
> 2) A function which modifies LANG should restore the original value
>    before returning. So if a specific function needs LANG=C or maybe
>    LANG=de_AT.utf8 to achieve a specific effect, it can change it, but
>    it must change LANG back to the value it was before. It can't just
>    set it and leave it at that value. If LANG can change its value
>    seemingly at random during execution, that's a maintenance nightmare.
> 
> (That's a non-exclusive or, btw)

This is useful but perhaps it should be "and" rather than "or" and you
have said "should" and "must" in paragraph (2) but I think you intended
"must" throughout.

> 
>       hp

-- 
--gh


Reply via email to