Is there a way to get the letters of the alphabet in a language?
I want to do paging, and I want to show for example the last 7 letters of the alphabet. For the dutch alphabet t-z are the last 7 letters, but for Sweden it's w-ö (which is w x y z å ä ö).
And when I get that as input, for the "normal" a-z alphabet I can generate the letters in between by using the ASCII table, but for Sweden that won't work.
To the best of my knowledge, neither .NET nor Windows provide this information. However, you can find it in the Unicode Consortium's CLDR database. This DB is actually a set of XML files (one for each language. named after the language abbreviation) containing all sorts of localisation info. A gold mine!
the element /ldml/characters/examplarCharacters contains a list of characters used in the language. e.g., for Swedish (sv.xml):
[a-v x-z å ä ö]
Note that when you say 'ASCII letters', you do realize you're limiting yourself to the Latin script, don't you? As far as ar the CLDR is concerned, lists such as a-z are Unicode characters sequences, not just ASCII letters. eg, in Russian (from ru.xml):
[а-е ё ж-я]
I don't think it's accessible programmatically by default but here's a good set of reference documents at the Evertype website
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With