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