wdas / SeExpr

SeExpr is an embeddable, arithmetic expression language that enables flexible artistic control and customization in creating computer graphics images. Example uses include procedural geometry synthesis, image synthesis, simulation control, crowd animation, and geometry deformation. https://wdas.github.io/SeExpr
https://www.disneyanimation.com/open-source/seexpr/
Other
406 stars 86 forks source link

SeExpr library and demos are vulnerable to the current C locale #100

Open amyspark opened 4 years ago

amyspark commented 4 years ago

Hey,

I've tried compiling SeExpr's demos with Qt 5.12.7 on Manjaro and macOS Mojave (the latter through Homebrew).

In both cases, the ccolor widget in the Image Synthesis Editor initializes to a default yellow value and forcibly overrides the value set in the script. This doesn't happen in Windows 10 x64 (with the same Qt version).

The reason is that, in the Bison parser and the imageEditor demo all floating point parameters are parsed using atof(). Under Qt-based apps, the LANG and LC_ALL environment variables govern floating-point number format. I'm using es_ES.UTF8, which re-uses , as the decimal point separator.

davvid commented 3 years ago

We'd be happy to take fixes in this area. It'd be good to make the code not dependent on the locale.