I am using e57 library (http://www.libe57.org/) and I have a e57 data set that I can read them correctly, when the decimal point in windows is set to '.', but on a system that decimal point is ',', it doesn't work properly (for example on windows with language set to Spain or Norway and several other European language).
To test the correctness my code, I am using demoRead application which is shipped by this library.
I can see that when the locals are set so decimal point is '.', application can read data for a point as :
x=0.24965 y=-0.1595 z=-0.29536
but if I change the decimal point in windows setting to ',' Then application read these values:
x=24965 y=-15950 z=-29536
As I don't want to look at the bug in this big library, I am wondering if there is a way that I can change the locals for my application in code?
I already tried to do this using this code:
setlocale(LC_ALL,"en-US");
without any success. Is there any way that I can change the decimal point char in code that effect all IOs even they are deep inside a library?
You can set LC_NUMERIC for the decimal point. For monetary-formatting you can set LC_MONETARY.
LC_NUMERIC is only for the "printf family" and localeconv
http://msdn.microsoft.com/en-us/library/x99tb11d.aspx