How to

get Windows (ANSI) code page for culture

Published: 11. October 2011 | Updated: 11. October 2011
License: Microsoft Public License (MS-PL)
Categories: Globalization » Text
Tags: C# Globalization
Was this snippet helpful for you? YESYES / NONO

Import namespace

using System.Globalization;

Code

var culture = CultureInfo.GetCultureInfo("en-US");
TextInfo textInfo = culture.TextInfo;
int ansiCodePage = textInfo.ANSICodePage;

Console.WriteLine(ansiCodePage);
Console Output:
1252
Send us feedback about this snippet »



Related Snippets: