S
Stephan Rose
I am really going nuts here.
An application I started working on, used entirely by english-speaking
users so I have no interest in supporting multiple languages. However
the application does not always run on an english version if windows.
Some of these users are located in various countries in europe and so
their culture settings are different and its causing me a major
headache!!!!
Particular what is causing me extreme headaches is converting strings
to float, and vice versa. All the data files in XML are in english
format so the floats are represented as 1,234.56 which was at first
causing float.Parse to horribly crash. So after adding
CultureInfo.Invariant to every single call to float.Parse that went
away.
Now though I am dealing with the next problem that they can correctly
open the data files, but when they are being saved again it is saving
them with their local cultural settings so the 1,234.56 becomes
1.234,56 which means now when the file is being reopened the number
because 123456 as the , is just being dropped!! Needless to say, this
is corrupting the data and causing all sorts of issues...
I really do not want to add a CultureInfo.Invariant to every number /
text conversion in the entire program. I mean I will if I have
to...but seriously....
Is there any way for me to tell the framework at the beginning one
single time to use Invariant culture settings without me having to
specify it for every single Convert, Parse, ToString call?
Thanks in advance,
An application I started working on, used entirely by english-speaking
users so I have no interest in supporting multiple languages. However
the application does not always run on an english version if windows.
Some of these users are located in various countries in europe and so
their culture settings are different and its causing me a major
headache!!!!
Particular what is causing me extreme headaches is converting strings
to float, and vice versa. All the data files in XML are in english
format so the floats are represented as 1,234.56 which was at first
causing float.Parse to horribly crash. So after adding
CultureInfo.Invariant to every single call to float.Parse that went
away.
Now though I am dealing with the next problem that they can correctly
open the data files, but when they are being saved again it is saving
them with their local cultural settings so the 1,234.56 becomes
1.234,56 which means now when the file is being reopened the number
because 123456 as the , is just being dropped!! Needless to say, this
is corrupting the data and causing all sorts of issues...
I really do not want to add a CultureInfo.Invariant to every number /
text conversion in the entire program. I mean I will if I have
to...but seriously....
Is there any way for me to tell the framework at the beginning one
single time to use Invariant culture settings without me having to
specify it for every single Convert, Parse, ToString call?
Thanks in advance,