39

I want to insert a null character (ASCII Value 00) into an open file in Notepad. A program that is reading this file is expecting 00 at the end, but it's getting the ASCII value for space - 20.

How can I achieve this?

3 Answers3

32

This is not possible to do with Notepad, however, it can be done with a more advanced editor.

With Notepad++

  1. Go to Edit > Character Panel to show the ASCII Insertion Panel.

  2. Put the cursor where you want to insert the character.

  3. Double-click the character (in the Character column) to insert.

    ASCII Insertion Panel

mbomb007
  • 777
14

With Notepad++

From HEX

  1. Type 00 00 00
  2. Select this text
  3. TextFX > TextFX Convert > Convert Hex to text

From Base64

  1. Type AA==
  2. Select this text
  3. Plugins > MIME Tools > Base64 Decode

The mapping is:

NUL -> AA=
NUL NUL -> AAA=
NUL NUL NUL -> AAAA
alex2k8
  • 249
6

Normal text editors such as Notepad usually do not have the capability to enter NUL characters into files. What you probably want to do is to use a "hex editor" (some text editors also have a "hex" mode). This will let you enter NUL characters, or any other byte you might need.

Greg Hewgill
  • 5,619