I need to edit some UTF-8 text that contains control characters (including NUL, used to mark in that text where "C strings" end).

Most text editors either break, because they want "pure text" without any special characters, and most binary files editors assume that your text is ASCII, the few ones that support Unicode only let you choose UTF-16 or UTF-32.

I am on OS X, but recommendations for other OSes are welcome too, since I didn't found that even for other OSes.

  • AFAIR, Notepad++ on Windows can show those non-printables using inverted colors (so they look like tags). It supports UTF8. On Linux, I often use Midnight Commander's internal editor, which shows a "dot" in inverted colors wherever such a non-printable is; selecting it with the cursor shows you its hex code. Honestly, on Linux I never encountered an editor that "breaks" on them – but I did not really test too many and neither have too many text files containing unprintable characters :) – Izzy Dec 6 '16 at 7:19
  • 1
    software that shows them are common, my problem is EDITING them... I don't tested Notepad++ for this yet though. – speeder Dec 6 '16 at 16:13
  • Ah, sorry – missed that part... That rules out MC (unless you count copy-paste). – Izzy Dec 6 '16 at 18:27
  • copy paste would work... I wonder if I can install MC or a clone of it on OSX – speeder Dec 6 '16 at 20:48
  • 1
    Good news is: MCEdit actually has a OSX port and it works great. Neutral news is: it has shortcuts to insert several control chars. Bad news is: NUL has no shortcut, and it struggles with UTF-8, since its engine assume constant-width (in bytes) characters. :/ – speeder Dec 6 '16 at 21:20

Give the CudaText a try.

  • Free, open source
  • For MacOS, Linux, Windows
  • Supports binary files, via showing non-text chars like "x00" for 0-char, and keeps these chars on saving correctly

binary file opened

  • seemly this nailed it perfectly!!! – speeder Dec 7 '16 at 15:02

Give BareBones Softwares TextWrangler &/or BBEdit a go:

  • TextWrangler is Free (Gratis) and BBEdit offers a 30 day trial then is $49.99 to keep all of the features.
  • UTF-8 Support in available in both
  • Platform OS-X
  • Good support for Non-Printables such as 0x00
  • 1
    awesome :) I will mark this as correct answer, despite them showing only "????" characters, because what I wanted is somethign that can edit said characters, and it actually can do that, despite the very unhelpful rendering. Workflow now is edit in TextWrangler, then open in Sublime Text to see if I edited it correctly. – speeder Dec 6 '16 at 16:47

As you're on OSX I would try Sublime Text - https://www.sublimetext.com/ It's very customisable and allows plugins, but will handle non-printing characters with ease.

  • 1
    I asked the question BECAUSE sublime text. I tried to use it to edit the said text I mentioned, and it didn't worked. It can DISPLAY such characters, but can't edit them (aside from erasing them). I did talked on irc with SText author though, and he said the culprit was OSX itself, since SText DO send the special characters to the OS (for example to the clipboard), and is OSX that don't handle them properly. – speeder Dec 6 '16 at 16:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.