How to determine if a CultureInfo instance supports Latin characters

巧了我就是萌 提交于 2019-12-08 17:20:51

问题


Is it possible to determine if the CultureInfo instance that I am working with is based on a Latin character set or not?


回答1:


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




回答2:


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.



来源:https://stackoverflow.com/questions/6127277/how-to-determine-if-a-cultureinfo-instance-supports-latin-characters

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!