[osg-users] [osgPlugins] Conflict between OSG and Qt

Robert Osfield robert.osfield at gmail.com
Thu Mar 15 09:20:20 PDT 2018

Hi Joseph,

On 15 March 2018 at 08:46, Joseph Mirabel <josephmirabel at gmail.com> wrote:
> I found the bug. The fault is from Collada Dom library. Qt is settings the numeric locale to french (because it is the default on my computer). The Collada Dom uses sscanf to parse string as double. In french, the decimal separator is a comma, not a point so string("0.5423") gives double(0)...
> See this bug report: https://sourceforge.net/p/collada-dom/bugs/137/

I have just checked out the Collada DOM 2.5 from github
(https://github.com/rdiankov/collada-dom) and updated the OSG's
FindCOLLADA.cmake to be able to find the 2.5 DOM and checked this into
OSG master.  I did a quick search through the collada_dom code base
for setlocale and there are:

collada-dom$ grep -r "setlocale" .
./dom/external-libs/pcre-8.02/dftables.c:  setlocale(LC_ALL, "");
  /* Set from environment variables */
./dom/external-libs/pcre-8.02/pcretest.c:      if (setlocale(LC_CTYPE,
(const char *)pp) == NULL)
./dom/external-libs/pcre-8.02/pcretest.c:    setlocale(LC_CTYPE, "C");
./dom/external-libs/pcre-8.02/pcregrep.c:  if (setlocale(LC_CTYPE,
locale) == NULL)

I'm not the author of the OSG's dae plugin so know little more than
what has been required to compile against the Collada DOM so can't
provide much insight it this issue.  The Collada DOM really looks a
bit stagnant now so perhaps bugs like the locale one are basically
just ignored.  Potentially one could fork the project on github and
make fixes then push this, or put setlocale settings local to the
OSG's dae plugin.

I'm open to suggestions.


More information about the osg-users mailing list