POV-Ray : Newsgroups : povray.general : qtpovray-3.80.1 for Linux : Re: qtpovray-3.80.1 for Linux Server Time
5 May 2024 06:01:08 EDT (-0400)
  Re: qtpovray-3.80.1 for Linux  
From: clipka
Date: 1 Aug 2018 05:02:40
Message: <5b617730$1@news.povray.org>
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


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.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.