Strange setLocale call in Storage_Schema::ICreationDate()

What is the purpose of the line 1549
(void)setlocale(LC_ALL, "");
in Storage_Schema.cxx, Storage_Schema::ICreationDate()?
And more important why is the locale not set back, like LC_NUMERIC in the same function? This function gets called everytime I use the OCC save mechanism. This (for me) unrecognized change of the localization messed things up in the rest of my application.

As a fix I used the OSD_Localizer to encapsulate my OCC calls and prevent interference with my own localization settings.
But I think this should still be considered a bug.

Markus Rhein's picture

I don´t think OSD_Localizer is working as intended.
Is it possible that the variable myLocale can get corrupt before restore () gets called?

Also I would suggest restoring the original localization settings in the destructor of OSD_Localizer.

Forum supervisor's picture

Dear Markus,
I would like to inform you that the posted problem is checked and accepted as a bug.
The corresponding issue with ID = 22808 has been registered.
Later you can know if the issue is resolved by checking references to the specified ID in OCCT Release Notes. The analysis of the issue will take some time depending on our technical capability and availability of resources.
Thanks for your contribution.

Denis Barbier's picture

You can comment out all calls to setlocale here, this function does not use locales. (Ditto in XmlLDrivers.cxx)