5

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.

terdon
  • 242,166
Sidahmed
  • 1,328
  • 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. – ctrl-alt-delor Jan 17 '17 at 09: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 09: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.) – ctrl-alt-delor Jan 17 '17 at 09: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 09:43
  • @AlexP I know that it is a big table, but the manual pages are compressed using gzip, so I doubt the manual page for such a table will even exceed 1Mb. – Sidahmed Jan 17 '17 at 09:46
  • 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 09:51
  • Oh how many times have I seen an Ascii table in code implemented as an array ( 0=0, 1=1, 2=2, 3=3, …………), this is what would be in the man page. The look up to glyphs (What they look like), is done by the rendering engine, of what ever is displaying the text. – ctrl-alt-delor Jan 17 '17 at 09:56

1 Answers1

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