[GRASS-dev] g.mlist, g.mremove fails in non-English locale

Hamish hamish_b at yahoo.com
Sun Apr 6 18:27:47 EDT 2008


Maciej Sieczka wrote:

>   My locale is:
> 
> $ locale
> LANG=pl_PL.UTF-8
> LC_CTYPE="pl_PL.UTF-8"
> LC_NUMERIC="pl_PL.UTF-8"
> LC_TIME="pl_PL.UTF-8"
> LC_COLLATE="pl_PL.UTF-8"
> LC_MONETARY="pl_PL.UTF-8"
> LC_MESSAGES="pl_PL.UTF-8"
> LC_PAPER="pl_PL.UTF-8"
> LC_NAME="pl_PL.UTF-8"
> LC_ADDRESS="pl_PL.UTF-8"
> LC_TELEPHONE="pl_PL.UTF-8"
> LC_MEASUREMENT="pl_PL.UTF-8"
> LC_IDENTIFICATION="pl_PL.UTF-8"
> LC_ALL=
> 
>   In this locale g.mlist is broken. Eg. the command:
> 
> g.mlist rast pat=* sep=,
> 
>   prints the following:
> 
>
dostêpnych,mapsecie,N51E015.hgt,N51E016.hgt,<PERMANENT>:,plików,raster,w
> 
>   instead of only:
> 
> N51E015.hgt,N51E016.hgt
> 
> This also breaks g.mremove in turn.
> 
> It looks that the Polish translation "raster plików dostêpnych w 
> mapsecie <PERMANENT>:", used in g.list, gets mixed into g.mlist output.
> 
> What's wrong?

The g.mlist script relies on the g.list module being run untranslated.

The immediate fix is to add a couple of lines to the start of the script
temporarily disabling the locale settings, much like is done for scripts
that use awk to stop "," being used as the decimal marker.

The long term fix is to rewrite g.mlist not to be a hack.


Hamish



      ____________________________________________________________________________________
You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost.  
http://tc.deals.yahoo.com/tc/blockbuster/text5.com



More information about the grass-dev mailing list