From: Harm van der Heijden <harm@et...> - 2001-12-24 18:57:28
Just a little note of warning about external config files. In retrospect
it's perfectly obvious, but it took me a while to figure out. I don't
think many plugins use external config files, but if your code does, read
Xine's dxr3 driver reads overlay data from a file created by em8300's autocal.
This file contains floating point values in ascii text.
The problem was that autocal doesn't use localization, while xine-ui
does. For one user, who had french locale settings, this caused
problems, because atof and sscan("%f") translated "0.543" as "0,0" (because
the decimal '.' was not recognized as decimal point).
The fix is this:
char *loc = setlocale(LC_NUMERIC, NULL); /* save setting */
/* parse file using atof, or sscanf("%f") or whatever */
setlocale(LC_NUMERIC, loc); /* restore locale */