访问 UTF-8 楔形文字数字和标点符号

访问 UTF-8 楔形文字数字和标点符号

有人知道如何访问 UTF-8 楔形文字数字和标点符号吗?

  twash="\u12400"       # two ash
  thash="\u12401"       # three ash
  frash="\u12402"       # four ash
  fvash="\u12403"       # five ash
  sxash="\u12404"       # six ash
  svash="\u12405"       # seven ash
  eiash="\u12406"       # eight ash
  niash="\u12407"       # nine ash
  thdsh="\u12408"       # three dish
  frdsh="\u12409"       # four dish
  fvdsh="\u1240a"       # five dish
  sxdsh="\u1240b"       # six dish
  svdsh="\u1240c"       # seven dish
  eidsh="\u1240d"       # eight dish
  nidsh="\u1240e"       # nine dish
  fru="\u1240f"         # four u

以下确实让我得到了正确的数字符号。

  echo ""
  echo "> cunif-numpc-utf-scout"

  echo -e "twash: $twash" "| thash: $thash" "| frash: $frash" "|" \
          "fvash: $fvash"

  echo -e "sxash: $sxash" "| svash: $svash" "| eiash: $eiash" "|" \
          "niash: $niash"

  echo -e "thdsh: $thdsh" "| frdsh: $frdsh" "| fvdsh: $fvdsh" "|" \
          "sxdsh: $sxdsh"

  echo -e "svdsh: $svdsh" "| eidsh: $eidsh" "| nidsh: $nidsh" "|" \
          "fru: $fru"

答案1

你必须使用\UHHHHH,而不是\uHHHHH。小写最多只允许四个十六进制数字作为转义序列的一部分。大写的U最多允许 8 个。

有了这个改变,你应该得到

> cunif-numpc-utf-scout
twash: 

相关内容