non-Unicode programs

  • Thread starter Thread starter LinasB
  • Start date Start date
L

LinasB

Hi,

How to read system setting value of "Language for non-Unicode programs" ?
Or how to set it programmatically?

LinasB
 
Linas,

Can you be more precise what you mean. In dotnet a string is forever
Unicode.

Cor
 
Can you be more precise what you mean. In dotnet a string is forever


I know this. Problem is out there.
My program is reading some data, which is not Unicode.
The result are bad, if in "Regional and language settings" in advanced tab
"Language for non-Unicode programs"
defined other language.
 
Linas,
Are you referring to the Regional settings in Control Panel?

System.Text.Encoding.Default will return an Encoding object that matches the
Regional settings in Control Panel. Useful for reading & writing files with
StreamReaders & StreamWriters.

You can use
System.Text.Encoding.GetEncoding(System.Globalization.CultureInfo.CurrentCulture.TextInfo.OEMCodePage)
to get your DOS or OEM encoding.

FWIW: TextInfo.ANSICodePage is the Windows encoding.

I normally only need to use System.Text.Encoding.Default. The use of
CultureInfo.CurrentCulture & CultureInfo.CurrentUICulture is implicitly used
by a number of objects (commonly overridden ToString methods).

NOTE: CultureInfo.InstalledUICulture will return the "culture installed with
the operating system" which may or may not match your regional settings.

Hope this helps
Jay

| Hi,
|
| How to read system setting value of "Language for non-Unicode programs" ?
| Or how to set it programmatically?
|
| LinasB
|
|
 
Linas,
I know this. Problem is out there.
My program is reading some data, which is not Unicode.
The result are bad, if in "Regional and language settings" in advanced
tab "Language for non-Unicode programs"
defined other language.
I had this a while as well, when I was experimenting with it. Those two
pages did help me.

http://www.geocities.com/Athens/Academy/4038/graph/fontset.htm#b

http://www.microsoft.com/globaldev/reference/oslocversion.mspx

I hope this helps you as well,

Cor
 
Back
Top