Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
List installed codepages
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00901344
Message ID:
00901487
Views:
9
This message has been marked as the solution to the initial question of the thread.
Christopher,

You need to use the CultureInfo class found in the System.Globalization namespace. This class will allow you to interrogate the current OS's codepage (OEM, Ansi, DOS, Mac) through the TextInfo class.
using System;
using System.Globalization;

public class Test
{
   public static void Main()
   {
      // Show them all.
      foreach (CultureInfo cInfo in CultureInfo.GetCultures(CultureTypes.AllCultures))
      {
         Console.WriteLine(cInfo.TextInfo.OEMCodePage);
      }

      // Show the culture associated with the OS.
      Console.WriteLine(CultureInfo.InstalledUICulture);

      // Show the culture associated with the current thread.
      Console.WriteLine(CultureInfo.CurrentCulture);
      Console.WriteLine(CultureInfo.CurrentCulture.TextInfo.OEMCodePage);
   }
}
Regards
Neil
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform