Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

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

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

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

4 Answers 4

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.

share|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
    
Excellent, that's what I needed. –  noob Jan 23 '13 at 9:06

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.

share|improve this answer

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
share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.