一共有7种子组合
01 [,2C][.2E] en-US
02 [ C2A0][,2C] fr-FR
03 [.2E][,2C] da-DK
04 [’E28099][.2E] de-CH
05 [ C2A0][.2E] tn-BW
06 [,2C][/2F] fa-IR
07 [’E28099][,2C] wae-CH
var list = CultureInfo.GetCultures(CultureTypes.AllCultures);
Dictionary<string, List<string>> dic = new Dictionary<string, List<string>>();
foreach (var item in list)
{
var cultureInfo = item;
NumberFormatInfo numberFormat = cultureInfo.NumberFormat;
byte[] utf8Bytes = Encoding.UTF8.GetBytes(numberFormat.NumberGroupSeparator);
byte[] utf8Bytes2 = Encoding.UTF8.GetBytes(numberFormat.NumberDecimalSeparator);
//Console.WriteLine($"{cultureInfo.Name}: Thousand Separator: [{numberFormat.NumberGroupSeparator}{HexHelper.GetHexStringFromByteArray(utf8Bytes)}], Decimal Separator: [{numberFormat.NumberDecimalSeparator}{HexHelper.GetHexStringFromByteArray(utf8Bytes2)}]");
var key = $"[{numberFormat.NumberGroupSeparator}{HexHelper.GetHexStringFromByteArray(utf8Bytes)}][{numberFormat.NumberDecimalSeparator}{HexHelper.GetHexStringFromByteArray(utf8Bytes2)}]";
if (!dic.ContainsKey(key))
{
dic.Add(key, new List<string>() { cultureInfo.Name});
}
else
{
dic[key].Add(cultureInfo.Name);
}
}
int i = 0;
foreach(var item in dic)
{
i++;
Console.WriteLine($"{i:D2} {item.Key}");
}
标签:group,combination,numberFormat,GetHexStringFromByteArray,dic,separator,2C,var,cu From: https://www.cnblogs.com/chucklu/p/18152938