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?

link|improve this question
1  
I 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. – tkryger Oct 26 '09 at 7:06
feedback

migrated from stackoverflow.com Oct 28 '09 at 0:11

This question came from our site for professional and enthusiast programmers.

5 Answers

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.

link|improve this answer
feedback

Alt + 256 works for me. But thats just one at a time.

The plugin HEX-editor is easier if you want heaps of Nul's at a time.

link|improve this answer
1  
wait, im talking about Notepad++ – RND Jan 27 '10 at 3:55
Thanks for you answer! – Konstantin Spirin Feb 18 '10 at 2:37
feedback

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
link|improve this answer
feedback

Yep open your text file in a hex editor and edit the hex instead of the text!

link|improve this answer
feedback

try new a file called a.txt, then open it with hex editor like ultraEdit, ctrl + H to enter hex editing mode, at that time, you will be fine with whatever byte you wanna insert.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown