How to Insert a Null Character (ASCII 00) in Notepad?

30

6

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?

jeromekjeromepune

Posted 2009-10-26T06:47:56.133

Reputation:

If it did work, you'd only need two zeros, not four. Alt+09 works for Tab, for example. – mbomb007 – 2017-03-13T19:38:00.307

2I had hoped that holding Alt and pressing four zero on the numpad would insert the null the same way it inserts all of the fÜn printable characters but it doesn't. – None – 2009-10-26T07:06:40.127

Answers

19

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 to insert.

    ASCII Insertion Panel

mbomb007

Posted 2009-10-26T06:47:56.133

Reputation: 464

1@DavidPostill It's Notepad++, which is actually what I was searching for when I found this question. – mbomb007 – 2016-09-24T18:06:45.240

That doesn't help when the OP us using Notepad. – DavidPostill – 2016-09-24T18:08:07.860

4

@DavidPostill This isn't for the OP anymore. This is for users who find this question when searching. The OP got what he wanted years ago and deleted his account. Besides, this answer is also Notepad++

– mbomb007 – 2016-09-24T18:09:02.723

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

Posted 2009-10-26T06:47:56.133

Reputation: 249

Your steps don't match your mappings. You say AA== in one place and AA= in another. – mbomb007 – 2016-09-23T18:26:54.170

1Please read the question again carefully. Your answer does not answer the original question. The OP is using Notepad. – DavidPostill – 2016-09-24T20:06:55.147

2@DavidPostill The OP asked for something that is impossible, so it's fine that he provide an alternative method of entering a NUL into a file. – mbomb007 – 2017-03-09T14:27:58.253

5

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

Posted 2009-10-26T06:47:56.133

Reputation: 5 099