|
|
On 08/01/2018 05:02 AM, clipka wrote:
> Am 01.08.2018 um 10:33 schrieb clipka:
>
>> @dick: Are you actively changing the C/C++ locale in qtpovray, or do you
>> happen to know whether Qt does so by default? (buzzword `setlocale`)
>
> Never mind that question. According to StackOverflow, QCoreApplication
> (on Unix/Linux) does indeed invoke
>
> setlocale(LC_ALL,"")
>
> which screws up things. The suggested solution is to invoke
>
> setlocale(LC_ALL,"C")
>
> right after initialization of QCoreApplication or QApplication. See here:
>
>
https://stackoverflow.com/questions/25661295/why-does-qcoreapplication-call-setlocalelc-all-by-default-on-unix-linux
>
Reading that, it seems that I need to wrap POV-Ray with
setlocale(LC_ALL,"C") and let Qt be Qt. Like, call setlocale when
creating a session. Hmm, that will be messy; when getting a message from
POV-Ray I would have to setlocale(LC_ALL, "") and then set it back to
"C" after processing the message.
But, iirc, the povray parser doesn't like umlauted characters ("C"
locale) so maybe I should just force "C" all through the program and
abandon hope of spiffy translations.
>
> Unfortunately there is no portable way to fix this in POV-Ray itself,
> short of completely re-writing all code that currently depends on the
> C/C++ locale setting. At the moment, there is probably a host of such
> locale-dependent sections in the POV-Ray source code, only very few of
> which have already been identified as such.
>
> The C and C++ standards guarantee that at program startup the locale is
> set to the "C" locale, and all locale-dependent code in POV-Ray relies
> on this remaining unchanged.
>
--
dik
Rendered 328976 of 330000 (99%)
Post a reply to this message
|
|