octave-maintainers
[Top][All Lists]
Advanced

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

locales support in sscanf. Bug 35364


From: Andreas Weber
Subject: locales support in sscanf. Bug 35364
Date: Mon, 17 Dec 2012 12:30:13 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.10) Gecko/20121027 Icedove/10.0.10

Dear maintainers,
for almost a year I see this bug when running "make check"
http://savannah.gnu.org/bugs/?func=detailitem&item_id=35364

assert (sscanf ('1,2', '%f', 'fr_FR'),1.2)

Which fails when there is no fr_FR locale on the system. This has also been discussed on
http://octave.1599824.n4.nabble.com/sscanf-locale-on-MacOS-X-td4631822.html

Should we run the test only if the locale is installed? Something like

[r,l]=system("locale -a");
if (findstr(l,"fr_FR\n"))
    assert (sscanf ("1,2", "%f", "fr_FR"), 1.2)
endif

(perhaps guarded with isunix, ismac, ispc)
or should we remove the test because it is only valuable for a little group?

Pascal Dupuis made also a suggestion with warning_with_id (see bug report on savannah) which was not accepted.

I think the right way if we want to test this is to
* get a list of all locales which use a comma as decimal separator
* get the currently available locales
* compare which of them use comma as decimal separators
* test these

Regards, Andy


reply via email to

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