4

The ascii table can be displayed from the terminal using man ascii.

So, is there a package I can install to show the utf-8 and unicode table from the terminal? For example, when I type man utf-8, a utf-8 character table is displayed ; and when I type man unicode, a unicode character table is displayed.

7
  • Why do you need it? I have worked with people that are constantly looking up ascii codes. I have no idea why, as I do the same work without looking them up (or knowing them). Most programming languages let use use the character as a symbol for the code. All the programming languages that I have used recently(C, python, bash, html, css, javascript, …) allow we to include unicode into strings (direct / no codes). To aid typing of the non-ascii unicode characters, I have enabled and use the compose key. Jan 17 '17 at 9:22
  • In the pentesting world, they are needed a lot. Because you always need to put the unicode (or utf-8) presentation of a character when trying to test url parameters and other stuff.
    – Sidahmed
    Jan 17 '17 at 9:25
  • You can use a url encoder. Also URLs don't contain utf-8: Then take the unicode code point and url encode it. (utf-8, utf-16, url encodeing, are all encodings. Unicode is what is encoded.) Jan 17 '17 at 9:39
  • 2
    You do realize that there are over one hundred thousand characters in Unicode, don't you? That would be one big table. And UTF-8 is just an encoding for Unicode.
    – AlexP
    Jan 17 '17 at 9:43
  • 2
    @Sidahmed: The problem is not the size of the manual page. The problem is finding a character in the huge table, not to mention that most likely there is no font having all the characters. You are much better off using an online resource such as Richard Ishida's Uniview.
    – AlexP
    Jan 17 '17 at 9:51
9

Here is one that I quickly hacked together. It needs a little work on the formatting, but basicly it works.

#!/bin/bash
for y in $(seq 0 524287)
  do
  for x in $(seq 0 7)
  do
    a=$(expr $y \* 8 + $x)
    echo -ne "$a \\u$a "
  done
  echo
done
6
  • not working on bash May 11 '19 at 6:04
  • What are you getting? May 11 '19 at 10:37
  • 1
    it just prints out actual string "i.e. \\uXXXX" for some reason. in terminal - printf "\\uXXX" and echo -e "\uXXX" works. May 11 '19 at 11:46
  • What do you get if you type type echo? May 11 '19 at 11:49
  • unix.stackexchange.com/q/65803/5132 explains why this script does not work universally with the Bourne Again shell.
    – JdeBP
    Jan 2 '20 at 0:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.