octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

setlocale ?


From: CdeMills
Subject: setlocale ?
Date: Wed, 5 Oct 2011 09:51:36 -0700 (PDT)

Hello,

while trying to understand why a data file was not read correctly, I quiclky
found the culprit: it used french locales, with decimal separator set to ','
instead of '.'

To make libc functions like scanf et al. locale aware, the function
"setlocale" must be called. By default, it uses the locale value from the
environment variables LANG/LC_NUMERIC/LC_ALL

I quickly greped into the sources, and found only one call to 'setlocale' in
the source  DLD-FUNCTIONS/__magick_read__.cc
which is intended to read images with ImageMagick.

Would it be possible to either 
- place a call to  setlocale (LC_ALL, ""); at  Octave startup
- implement a setlocale into the interpreter as an interface to the libc
setlocale
in order to use the locales from the environment and make internal functions
all at once aware of locales conventions ?

Regards

Pascal

--
View this message in context: 
http://octave.1599824.n4.nabble.com/setlocale-tp3875161p3875161.html
Sent from the Octave - Maintainers mailing list archive at Nabble.com.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]