A
Alex Leduc
I'm trying to load ASCII files that contain characters from the French
language in a way that is independant of whatever Locale the machine is
configured to use.
So If I have machine who's default Locale is "en-US" and I open some
french text like this:
[C# exaple that has the same behaviour in any .net languages]
StreamReader sr = new StreamReader("C:\\someFrenchFile.txt");
string strInput = sr.ReadToEnd();
Suppose the file contains this:
"Le Québec en été."
the characters that I get in strInput are:
"Le Qu?bec en ?t?."
If I change the default Locale in the Control Panel and use
Encoding.Default in the StreamReader's constructor parameters, I get the
right characters in strInput:
"Le Québec en été."
What I'd like to be able to do is load the french string with the right
characters regardless of what's the machine's default Locale. What's the
way to programmatically decide what Locale to use with all ASCII strings?
Alexandre Leduc
language in a way that is independant of whatever Locale the machine is
configured to use.
So If I have machine who's default Locale is "en-US" and I open some
french text like this:
[C# exaple that has the same behaviour in any .net languages]
StreamReader sr = new StreamReader("C:\\someFrenchFile.txt");
string strInput = sr.ReadToEnd();
Suppose the file contains this:
"Le Québec en été."
the characters that I get in strInput are:
"Le Qu?bec en ?t?."
If I change the default Locale in the Control Panel and use
Encoding.Default in the StreamReader's constructor parameters, I get the
right characters in strInput:
"Le Québec en été."
What I'd like to be able to do is load the french string with the right
characters regardless of what's the machine's default Locale. What's the
way to programmatically decide what Locale to use with all ASCII strings?
Alexandre Leduc