Yves Bastide <[EMAIL PROTECTED]> writes:
| Locales, or: The Infamous 2,17 Problem.
|
| ``Warning: need lyxformat 2,17 but found 2,00'' plagues every user with
| funny (<g>) LC_NUMERIC. As everyone know, the .lyx file must be
| read/written in the C locale to have its \lyxformat correctly
| formatted.
What I wan to do it to change format to be a string or an integer.
Then we won't need the hack for this case. OTOH we probably have this
problem other places too.
| 1. The quickest fix: setlocale(LC_NUMERIC,"C") in main. I believe it's
| what's done in 1.1.5?
|
| 2. A better fix: temporary switching to the "C" locale when reading/writing
| files.
| In this case, should it use setlocale, locale::global or .imbue?
| setlocale is the only option when <locale> is not available. In the later
| case, imbuing the stream looks like the right thing---but there's a catch.
| lex.getFloat() uses strToDbl(), which calls ::atof... See the can of
| worms open (-:
string to double we later switch to use lexical_cast. It is also
possible with lexical cast to set the locale for a specific cast.
| I've implemented my #2 proposition. It adds a small header file (~100 lines
| with lots of whitespace) defining a hidding-the-#ifdefs class. It is
| instancied in buffer.C (writeFile) and lyxlex_pimpl.C (constructor, setFile,
| setStream).
|
| What do you LyXperts think?
Have to look at it first.
Lgb