NanoMichael / MicroTeX

A dynamic, cross-platform, and embeddable LaTeX rendering library
MIT License
403 stars 67 forks source link

Set LC_NUMERIC to "C" on init #124

Closed sp1ritCS closed 2 years ago

sp1ritCS commented 2 years ago

This is to work arround the decimal parsing implementation that expects comma as decimal seperator for de_DE (and maybe other langs to).

Currently $\LaTeX$ looks like this on a German system: Bildschirmfoto vom 2022-04-25 12-19-48

sp1ritCS commented 2 years ago

This is more or less straight up taken from our NoteKit implementation, where there was a similar bug, that resulted in broken JSON parsing by jsoncpp. Because the libc LANG isn't scoped, this bug never occurred in NoteKit since we've already set LC_NUMERIC to "C".

NanoMichael commented 2 years ago

TheLC_NUMERIC will affect the result of functions strtod, strtol, and so on, the first time I've heard about that, learned a lot 🎆 .