How to show ascii non-printable characters in Visual Studio Code?

6.4k views Asked by At

I'm using Visual Studio Code version 1.51.1 and am wondering if there is any way to display all of the ascii non-printable characters when looking at a file. I used to use Notepad++ and it had a feature you could turn on that would show every character in a file including non-printable characters.

For example, here's a screenshot from a file open in Notepad++ that I've inserted the non-printable BEL character in by pressing ALT + 007. You can also see the carriage-return/line feeds at the end of the line:

enter image description here

Here's a list of the characters I'm referring to (I found this list here):

enter image description here

So what I'm asking is there an extension I can install into Visual Studio Code or a setting that I can configure that will show all ascii characters, both printable and non-printable, similar to how Notepad++ does it as shown in the screenshot I provided? Thanks in advance.

2

There are 2 answers

1
Saw On BEST ANSWER

On the bottom-right corner of the status bar, you will see the encoding of the file. Click and select “Reopen with Encoding…” and change to something like UTF-8 or higher.

You can also search for the “Change File Encoding” task via Cmd+Shift+P.

0
Leo On

The Microsoft Hex Editor extension is a good option. Hex Editor data inspector.