[Skencil-users] sk2ps with different localization settings
Daniel Vicente Lühr Sierra
dluhr at ieee.org
Sun Jun 18 07:30:18 CEST 2006
Hi all!
I'm using skencil version 0.6.17 (specifically sk2ps) as part of the
building process of the Linux Brochure Project<http://lbproject.sourceforge.net>
My linux locale (LANG, LANGUAGE and LC_*) is set to es_CL.UTF-8 and sk2ps
fails when parsing the (float) numbers from a .sk file because of the
different decimal character. This was discussed in the old mailing list with
the topic "sk2ps now
fails<http://sourceforge.net/mailarchive/message.php?msg_id=14370371>"
started by Nicolas Ecarnot but no solution was given and I have not been
able to find a similar topic in the new mailing list or the old/new bugs or
patches tracker.
I am now using a work around the problem which may be useful to others:
import locale
...
#insert the folowing code before "locale afected" operations (i.e. scanf,
printf, ...) to set it to the (safer) `C' locale
original_locale = locale.setlocale(locale.LC_ALL, None)
locale.setlocale(locale.LC_ALL, 'C')
...
#add the following code to reset the locale to the default one after the
operations
locale.setlocale(locale.LC_ALL, original_locale)
Just as a "curiosity" regarding the decimal character. According to two
sources, the wikipedia (http://en.wikipedia.org/wiki/Decimal_separator) and
the spanish manual for the babel LaTeX system by Javier Bezos (
http://www.texytipografia.com/archive/spanish.pdf) the comma to mark the
decimal units position has been made standard by the
ISO<http://en.wikipedia.org/wiki/International_Organization_for_Standardization>for
international blueprints.
Best regards,
--
Daniel Vicente Lühr Sierra
Ingeniero Civil Eléctrico
Universidad de Chile
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wald.intevation.org/pipermail/skencil-users/attachments/20060618/4d84b85f/attachment.html
More information about the Skencil-users
mailing list