octave-maintainers
[Top][All Lists]
Advanced

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

Re: printf and locale


From: Pascal Dupuis
Subject: Re: printf and locale
Date: Mon, 25 Feb 2013 09:27:26 +0100

2013/2/25 John W. Eaton <address@hidden>:

> Whatever we decide, we need to take the following into consideration for
> compatibility with Matlab:
>
> http://www.mathworks.com/help/matlab/matlab_env/how-the-matlab-process-uses-locale-settings.html
>
> Note that Matlab unconditionally uses the C locale for LC_NUMERIC. Using
> something different is just begging for future bug reports about
> compatibility.
>

Wise point. I was a bit surprised that even ja_JP.UTF-8 and
ja_JP.eucJP can not be  safely mixed.

The issue I had to solve in the first place was READING csv files into
Octave. We should indeed align ourselves on MatLab to avoid potential
issues, yet provide some mean to deal with locales on external files.
The original patch I wrote was an extension to scanf. What about
extending the format strings used by scanf and printf to understand
the '%,;%f' and '%.;%f' extension ? This way every deviation from the
LC_NUMERIC "standard" behaviour must be explicitelly requested by the
user. No base code from Octave should use this mechanism, in order to
avoid issues and bug reports. So I repeat the question: Is "'%,;%f" a
C standard or some extension provided by National Instruments ?

Regards

Pascal


reply via email to

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