3

Using Linux (Fedora, specifically) as my primary workstation, I noticed, at times, strange non-printable characters like in the following screenshots (bottom-left in the first image and upper-left in the second image):

enter image description here

In the image above, the non-printable characters appeared in gnome-terminal with bash shell. I was quitting from ipython interactive shell by a sys.stdin.close() hacking.

enter image description here

In the image above, the character appeared in a webpage opened in firefox, specifically RFC 822 text file, just before the table of contents of this RFC.

I'm curious and want to know what they are. I infer that these are some sort of representation of Unicode. Am I right? If so, where is this kind of notation defined? What is it called?

  • It depends. Where are you seeing that? Is it in a pager (less or more or similar)? In the shell itself? They could be unicode or they could be ANSI color escape sequences or just binary data. PLease edit and give more context. – terdon Dec 9 '15 at 11:18
  • @terdon See my edit. – Naitree Dec 9 '15 at 11:27
1

Square box is usually for characters which absent in your current font. Code inside is two-byte UTF-8 character code. Modern terminals are UTF8, so you may get this if you try to output some binary data to your terminal. Seems you did something really strange with your python and python outputted some garbage to the screen, which were interpreted as unknown characters and you got some utf-8 garbage. You can always get similar random garbage with 'cat /dev/urandom'.

  • Thank you, Do you have any idea what this notation is called? (or where is it defined?) – Naitree Dec 9 '15 at 14:09
  • 1
    I am not entirely sure, but font rendering in Linux is done by libfontconfig. That might be their own convention. If your question would not catch anybody who knows, you could try to ask on fontconfig maillist. – gena2x Dec 9 '15 at 15:07
1

In the Firefox screenshot, you see the 0x0C character, or in ASCII, the Formfeed character, an instruction for printers to continue on a new page. See the screenshot. I've marked it light blue. It's somewhere inbetween UDel-Relay and Standard, and inbetween that code I see many 0A characters (line feed) and one 20 (space) and the 0C. You see that this editor shows these characters in light grey, which means they are non printing.

What I did: I saved the file. Then opened Jedit, and opened its Hex editor. That is a plugin that you can install in Jedit. There are probably many other hex editors, but this is the one I know and it's easy to use.

This does not explain what you see in Bash, but like Terdon said, that could be binary, unicode or non printable ASCII characters...

Jedit Hex editor

  • Thanks for your analysis. So it does represent hex value of character. Do you know what this notation is called? (or where is it defined?) – Naitree Dec 9 '15 at 14:00
  • In ASCII those characters are called control characters. How they are displayed depends on the program displaying them. Look at Emacs: gnu.org/software/emacs/manual/html_node/emacs/Text-Display.html: the ‘control-A’ character, U+0001, is displayed as ‘^A’. What you see in Bash may be something entirely different. You could cat the contents of a compiled program file, and then 0C may be part of code that has nothing to do with a form feed. When you display that in bash, it may act like a form feed onscreen, but that may not be what is intended. – SPRBRN Dec 9 '15 at 15:50
  • I have this in my terminal when '''I run nmblookup -M -- -''', how do I get rid? What fonts do I need to install? – Fiddy Bux Jan 5 at 18:50

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.