ifcplusplus icon indicating copy to clipboard operation
ifcplusplus copied to clipboard

Run-time error: setlocal en_us

Open marued opened this issue 6 years ago • 3 comments

I'm using the STEP importer in one of my project and I wanted to update the IfcPlusPlus to it's latest greatest. I'm encountering a new run time issue where a check is made to check the language setting of the system in the file ReaderSTEP.cpp line 79 to make sure the system has the local language en_us set. Obviously, my windows 10 system is not set to English and hence this line fails.

Why is this check made? and is it really wise to restrict the users to a single language setting? This could be a deal breaker for a lot of users.

Thanks in advance.

marued avatar Jan 25 '19 19:01 marued

Actually, it's possible the call actually requires admin rights on windows. My current user does not have the proper rights to change the local...

marued avatar Jan 25 '19 19:01 marued

I solved replacing "en_us.UTF-8" with "en-US".

"The locale argument can take a locale name, a language string, a language string and country/region code, a code page, or a language string, country/region code, and code page. The set of available locale names, languages, country/region codes, and code pages includes all those supported by the Windows NLS API except code pages that require more than two bytes per character, such as UTF-7 and UTF-8. If you provide a code page value of UTF-7 or UTF-8, setlocale will fail, returning NULL." link to microsoft page

Fed80 avatar Feb 19 '19 18:02 Fed80

Why is this check made? and is it really wise to restrict the users to a single language setting? This could be a deal breaker for a lot of users.

Would like to know this one too. Compiling fails on Debian with this switch. I got around by using the old behaviour if setlocale fails: https://github.com/berndhahnebach/ifcplusplus/commit/8429dc2ae32b4b88c8aed46ff979e3f7b8767e14

berndhahnebach avatar May 09 '19 20:05 berndhahnebach