nim-unicodedb icon indicating copy to clipboard operation
nim-unicodedb copied to clipboard

missing names for Runes from 0 to 0X1F

Open pietroppeter opened this issue 4 years ago • 1 comments
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

pietroppeter avatar Jun 28 '21 13:06 pietroppeter

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.

nitely avatar Jul 04 '21 02:07 nitely