Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Text editor that displays NULL characters?

693 views
Skip to first unread message

Patty Winter

unread,
Feb 28, 2012, 11:14:13 PM2/28/12
to
Is there a Mac-based program I can use to display NULL characters
in a text file? I've got a GPS receiver that has suddenly decided
to start adding them to a file it creates. Someone's been trouble-
shooting the problem for me, and on his Windows system, he used a
program called Notepadd++ and it told him there were null characters.

Using Word or Text Edit, all I see are spaces. (Yes, I'm displaying
hidden characters in Word. It displays symbols for spaces and
paragraphs, but not for the null spaces.) As the person helping me
pointed out, simply seeing extraneous spaces tells me that something
is wrong, but I'm still curious whether there's a program that will
tell me what *kind* of extraneous spaces they are.


Thanks,
Patty

Jolly Roger

unread,
Feb 28, 2012, 11:30:24 PM2/28/12
to
In article <4f4da615$0$12040$742e...@news.sonic.net>,
Personally, I'd use a Hex editor, because it will show you the raw
character codes of each character. Mac Update lists a few. Otherwise,
try TextWrangler's Show Invisibles function.

--
Send responses to the relevant news group rather than email to me.
E-mail sent to this address may be devoured by my very hungry SPAM
filter. Due to Google's refusal to prevent spammers from posting
messages through their servers, I often ignore posts from Google
Groups. Use a real news client if you want me to see your posts.

JR
Message has been deleted

Martin Frost me at invalid stanford daht edu

unread,
Feb 29, 2012, 1:38:59 AM2/29/12
to
pat...@sonic.net (Patty Winter) writes:

> Is there a Mac-based program I can use to display NULL characters
> in a text file? I've got a GPS receiver that has suddenly decided
> to start adding them to a file it creates. Someone's been trouble-
> shooting the problem for me, and on his Windows system, he used a
> program called Notepadd++ and it told him there were null characters.

emacs will do it. In fact it will display all control characters. It
displays a null as control-@ (which it is): ^@

Martin
Message has been deleted

dorayme

unread,
Feb 29, 2012, 6:00:08 AM2/29/12
to
In article <timstreater-0CD7...@news.individual.net>,
Tim Streater <timst...@greenbee.net> wrote:

> In article <4f4da615$0$12040$742e...@news.sonic.net>,
> pat...@sonic.net (Patty Winter) wrote:
>
> > Is there a Mac-based program I can use to display NULL characters
> > in a text file? I've got a GPS receiver that has suddenly decided
> > to start adding them to a file it creates. Someone's been trouble-
> > shooting the problem for me, and on his Windows system, he used a
> > program called Notepadd++ and it told him there were null characters.
>
> You can use TextWrangler (free) and set it to display invisibles. All
> your non-printing chars will show up as a grey diamond. You can't
> distinguish between them, but it doesn't sound like you need to.

In BBEdit and TW, the box to tick is under Edit menu, "Show
Invisibles", this gets some like line breaks. You need to also tick
the submenu to this "Show Spaces". There's also a separate box for
showing Tabs.

--
dorayme
Message has been deleted

David Empson

unread,
Feb 29, 2012, 7:39:52 AM2/29/12
to
Michael Vilain <vil...@NOspamcop.net> wrote:

> In article <4f4da615$0$12040$742e...@news.sonic.net>,
> pat...@sonic.net (Patty Winter) wrote:
>
> None of the editors I have (BBEdit, vim, or TextEdit) will display the
> "control characters" when embedded in a file. BBEdit has 'display
> invisibles' but it doesn't tell you they're 0x00 characters. They're
> mapped to nondisplayable characters. The only way I know to show the
> true stream of chacters is with a binary editor like 0xED, HexEdit,
> HexFiend, or SynalyzeItFree. But you can't edit the file with those
> applications, just display the binary data.

Also worth noting that BBEdit (and its free variant TextWrangler) have a
"Hex Dump Front Document" command, so you can load the file, show
invisibles to confirm there are unprintable characters, then do a hex
dump to see what they are.

When doing a hex dump, you should select the "Front document's file"
option, because BBEdit/TextWrangler converts to Unicode when it loads
files with 8-bit data, and if you dump the "contents" you will see the
translated Unicode data, which includes a lot of zero bytes that aren't
actually in the file.

--
David Empson
dem...@actrix.gen.nz

David Empson

unread,
Feb 29, 2012, 7:45:09 AM2/29/12
to
Tim Streater <timst...@greenbee.net> wrote:

> In article <dorayme-89677B...@news.albasani.net>,
> Edit -> Text Options ...
>
> and it doesn't show tabs, it shows tab *stops*. But Show Invisibles
> shows tabs as triangles. I can't remember what nulls etc show up as.

Red upside down question marks for all nonprintable control characters.

--
David Empson
dem...@actrix.gen.nz

Jolly Roger

unread,
Feb 29, 2012, 8:34:43 AM2/29/12
to
In article <1kg8ot4.1k1cd70fxc4i4N%dem...@actrix.gen.nz>,
Good tip, David. I hadn't realized TextWrangler had that command! That's
slick! Now I have no need to use a separate hex editor! Thanks. : )
Message has been deleted

Barry Margolin

unread,
Feb 29, 2012, 10:24:37 AM2/29/12
to
In article <myvcmqt...@Sunburn.Stanford.EDU>,
Martin Frost me at invalid stanford daht edu
It also has a hex mode:

M-x hexl-find-file

--
Barry Margolin, bar...@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***

Thomas O'Brien

unread,
Feb 29, 2012, 12:45:55 PM2/29/12
to
From the terminal:

man od

TFO

Patty Winter

unread,
Feb 29, 2012, 1:34:33 PM2/29/12
to
Thanks for the suggestions, everyone. I forgot to mention that
I had also tried vi running on my ISP's shell machine; both it
and "more" gave me blank spaces but no further information. I
just tried emacs and got the same result. I'm not going to try
the fancier options in emacs because I don't know how to use
it and had to close my SSH session just to get out of it. :-)

I tried TextWrangler and was able to display upside-down question
marks for the mystery characters, which at least was different
from the little diamonds for spaces. So that should suffice to
indicate when I have real spaces and when I have non-standard
characters. I don't really need the hex numbers on each character.

I'm going out geocaching again today, so I'll see whether my
GPS receiver is going to behave or whether it's going to keep
putting unwanted characters in its log files. It was fine for
months before this happened last week, so I hope it was just
a one-time glitch.


Patty

Message has been deleted

David Empson

unread,
Feb 29, 2012, 7:12:08 PM2/29/12
to
Tim Streater <timst...@greenbee.net> wrote:

> In article <1kg8ot4.1k1cd70fxc4i4N%dem...@actrix.gen.nz>,
> dem...@actrix.gen.nz (David Empson) wrote:
>
> That's interesting. And indeed, when I tried it with a small readme
> file, which is described by TW (at the bottom of the window) as "Unicode
> (UTF-8)", there's all those zero bytes. Now, if it's UTF-8, why are all
> those simple ascii chars showing up as 16 bit in the hex dump?

Because recent versions of BBEdit/TextWrangler convert everything to
UTF-16 when the file is loaded into memory for editing. The format popup
at the bottom only refers to the file format, not the in-memory format.

--
David Empson
dem...@actrix.gen.nz

Warren Oates

unread,
Mar 1, 2012, 8:28:45 AM3/1/12
to
In article <timstreater-12D8...@news.individual.net>,
Tim Streater <timst...@greenbee.net> wrote:

> Precisely why I never use emacs. On the two occasions I've started it by
> accident, it's taken 20 mins of footling about to find out how to get
> out of it. I can't remember whether cmd-q is available or not.

Heh. Ctl-x Ctl-c. You might be asked some questions about your open
(modified) "buffers".

Cmd-Q probably works in the GUI versions of Emacs.
--

... do not cover a warm kettle or your stock may sour. -- Julia Child

Barry Margolin

unread,
Mar 1, 2012, 9:47:41 AM3/1/12
to
In article <4f4f7991$0$2012$c3e8da3$e408...@news.astraweb.com>,
Warren Oates <warren...@gmail.com> wrote:

> In article <timstreater-12D8...@news.individual.net>,
> Tim Streater <timst...@greenbee.net> wrote:
>
> > Precisely why I never use emacs. On the two occasions I've started it by
> > accident, it's taken 20 mins of footling about to find out how to get
> > out of it. I can't remember whether cmd-q is available or not.
>
> Heh. Ctl-x Ctl-c. You might be asked some questions about your open
> (modified) "buffers".
>
> Cmd-Q probably works in the GUI versions of Emacs.

It probably depends which GUI version. The version I use maps the Cmd
key to Emacs's Meta, so Cmd-Q == M-q, which isn't quit. But GUI
versions also have a menu bar, so you can select Quit from there.
Message has been deleted

Barry Margolin

unread,
Mar 1, 2012, 1:02:56 PM3/1/12
to
In article <timstreater-9AC6...@news.individual.net>,
Tim Streater <timst...@greenbee.net> wrote:

> In article <barmar-F8527A....@news.eternal-september.org>,
> Barry Margolin <bar...@alum.mit.edu> wrote:
>
> > In article <4f4f7991$0$2012$c3e8da3$e408...@news.astraweb.com>,
> > Warren Oates <warren...@gmail.com> wrote:
> >
> > > In article <timstreater-12D8...@news.individual.net>,
> > > Tim Streater <timst...@greenbee.net> wrote:
> > >
> > > > Precisely why I never use emacs. On the two occasions I've started it
> > > > by
> > > > accident, it's taken 20 mins of footling about to find out how to get
> > > > out of it. I can't remember whether cmd-q is available or not.
> > >
> > > Heh. Ctl-x Ctl-c. You might be asked some questions about your open
> > > (modified) "buffers".
> > >
> > > Cmd-Q probably works in the GUI versions of Emacs.
> >
> > It probably depends which GUI version. The version I use maps the Cmd
> > key to Emacs's Meta, so Cmd-Q == M-q, which isn't quit.
>
> Which of course is a big no-no for *any* Mac application. What d'ye
> think this is, eh? Windows?

There are different ports of Emacs to the Mac GUI -- some stress Mac UI
compatibility, others Emacs familiarity. The one I use is Carbon Emacs,
and it defaults to using the Command key for meta, I think because the
key is easier to use than the Option key, but I think there's an option
to use Option.
0 new messages