nim-unicodedb
nim-unicodedb copied to clipboard
missing names for Runes from 0 to 0X1F
trafficstars
import strutils
import unicode
import unicodedb/names
template echoRune(n: int) =
let name = Rune(n).name
if name.len > 0:
echo "U+", toHex(n, 4), " ", name
for n in 0 .. 0x2A:
echoRune(n)
echo "..."
echoRune(0x03B1)
output:
U+0020 SPACE
U+0021 EXCLAMATION MARK
U+0022 QUOTATION MARK
U+0023 NUMBER SIGN
U+0024 DOLLAR SIGN
U+0025 PERCENT SIGN
U+0026 AMPERSAND
U+0027 APOSTROPHE
U+0028 LEFT PARENTHESIS
U+0029 RIGHT PARENTHESIS
U+002A ASTERISK
...
U+03B1 GREEK SMALL LETTER ALPHA
from: https://forum.nim-lang.org/t/8164
It seems those characters don't have their name defined in the UnicodeData.txt name field. Some of them have it in Unicode_1_Name field, though. But it seems Name_Aliases.txt is the right file to get those names from.
FWIW, Python throws an error when getting those characters names.