Skip to content

Instantly share code, notes, and snippets.

Avatar

Peter Foot peterfoot

View GitHub Profile
@pedrolamas
pedrolamas / CultureInfoHelper.cs
Last active Aug 15, 2021
Helper class to return the correct CultureInfo in UWP apps
View CultureInfoHelper.cs
using System.Globalization;
using System.Runtime.InteropServices;
using System.Text;
public class CultureInfoHelper
{
[DllImport("api-ms-win-core-localization-l1-2-0.dll", CharSet = CharSet.Unicode)]
private static extern int GetLocaleInfoEx(string lpLocaleName, uint LCType, StringBuilder lpLCData, int cchData);
private const uint LOCALE_SNAME = 0x0000005c;