Kaixo!

On Thu, Jul 06, 2000 at 12:33:19PM +0200, Pixel wrote:

> > This is a search in the output from wget. However as wget is localized it does
> > not always return the word "Length". 
> > The solution is to force wget to be localized to english, thus ensuring that
> > the script works. This can be done by adding: "export LC_ALL=en_UK;" to the 
> > line that calls wget. 
> > Line 3 then becomes:
> > ***********
> > $WGET = "export LC_ALL=en_UK;wget --passive-ftp";
> 
> thanks, done and uploaded in cooker.
> (at least i do $WGET = "LC_ALL=C wget --passive-ftp";)

LC_ALL=C will "unlocalize" strings get from the standard libc functions
(time format, number formats, etc); for actual translations done trough
gettext you alos need LANGUAGE=C

In other words, all automatic scripts must define

LC_ALL=C
LANGUAGE=C

any time they need to ensure a known state when running an external program
and reading back its output.

Note also that if such script interacts in some way with the user (printing
messages to him etc) it must not be completly unlocalized, so not

export LC_ALL=C
export LANGUAGE=C

but rather some

.....
  system("LC_ALL=C LANGUAGE=C foobar parameters");
....


Note also that even if the output is just numeric the "unlocalization" must
be done too; some locales may format numeric output differently (well, 
currently that isn't really very used; but with the outcome of glibc 2.2
it will finally happen)

-- 
Ki �a vos v�ye b�n,
Pablo Saratxaga

http://www.srtxg.easynet.be/            PGP Key available, key ID: 0x8F0E4975

Reply via email to