[Tilesathome] Inkscape locale issues. what were they?

Alfons Andorfer a_a at gmx.de
Sun Aug 31 08:50:13 BST 2008


spaetz wrote:
> Inkscape
> 
> 1) we set setlocale(LC_ALL to  $Config->get("InkscapeLocale"); before each call
> 2) in the commando line we use $Config->get("i18n") ? "LC_ALL=C " : ""
> 
> This gets the redundant redundancy award with a bonus for obfuscation. :-)
> Why 2 settings for 1 thing? 
> 
> This is not just ugly, but as we reset the locale to the old locale (which seems to return German on German computers) after each inkscape call with:
>   setlocale(LC_ALL, $oldLocale);
> 
> This leads us to insert the dreaded comma numbers as boundary coordinates in the .osm file which or/p complains about.
> 
> Why did we need to set the locale for inkscape again? I recall some bugs but nothing specifically, and it's not documented in the code (tss, tss, tss).
> 
> Do we really need LC_ALL or would some LC_NUMERIC suffice? What works on German boxes, German locales or 'C'?
Yes, you are right: LC_NUMERIC is enough.
The whole locale stuff is only needed because inkscape wants "," as 
decimal "points" in german locale (which is a bug in inkscape IMHO)

So just do a (from osm2tiles.pl)

my $old_locale = setlocale(LC_NUMERIC);
setlocale(LC_NUMERIC, "");
my $export_area= sprintf("%f:%f:%f:%f", $sx1, $sy1, $sx2, $sy2);
setlocale(LC_NUMERIC, $old_locale);

around the line where the "export area" for inkscape is generated and 
everything should go well!






More information about the Tilesathome mailing list