开发者

How to determine if a CultureInfo instance supports Latin characters

开发者 https://www.devze.com 2023-03-08 03:37 出处:网络
Is it possible to determine if the CultureInfo insta开发者_如何学Gonce that I am working with is based on a Latin character set or not?I believe you can use the CultureInfo.TextInfo.ANSICodePage.

Is it possible to determine if the CultureInfo insta开发者_如何学Gonce that I am working with is based on a Latin character set or not?


I believe you can use the CultureInfo.TextInfo.ANSICodePage. There are only so many of these (detailed here: http://msdn.microsoft.com/en-us/goglobal/bb964654).

You mostly just need to check that it's value is either 1252 or 1250


Not sure whether this is sufficient, but how about testing the CultureInfo.NativeName property for Latin characters using the CharUnicodeInfo.GetUnicodeCategory method

See also the Unicode UAX #24 on Script Properties and the Unicode Character to Script assignment table.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号