non-Unicode programs

L

LinasB

Hi,

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

LinasB
 
C

Cor Ligthert [MVP]

Linas,

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

Cor
 
L

LinasB

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.
 
J

Jay B. Harlow [MVP - Outlook]

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
|
|
 
C

Cor Ligthert [MVP]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top