Strange Characters

… No, not me!

I released Feeder 1.0.3 today. If you were to look at the list of changes you’d find nothing earth shattering, but the first item on the list is the reason I released this version now. The change was to strip out nasty control characters that could be pasted in from Dreamweaver, invalidating the feed.

I received a support request where FeedValidator was complaining about an early end of file in a feed. I checked the file in vi (then remembered I have TextWrangler, which can also show invisible characters and is free) and saw these ^@ (null) characters at the end of every chunk of text. Since these null characters are invisible, you can’t see them in the GUI – the cursor just gets stuck for a tap as you try to arrow-key over it. Otherwise, you won’t see anything wrong.

From a developer perspective, because text strings can be of variable lengths, strings in the C programming language are normally null-terminated – i.e. the text is followed by a null character (binary zero) to signify the end of the string; the size of the string field in memory can be much bigger. Variable-length strings can be handled another way by specifying the string’s length somehow. Maybe Dreamweaver has got the length one character too many, or maybe it needs this character for its own purposes.

Rant Alert!

In any case, this is really annoying! Applications shouldn’t put strange invisible characters on the clipboard and make it available to other apps. On the Mac, when an app puts something on the pasteboard it can supply a variety of different formats (e.g. RTF, Plain Text). It’s then up to the receiving application to use the richest or most appropriate type available. An application can also use its own proprietary pasteboard formats which only it knows about and uses. If Dreamweaver needs these null characters, that’s what it should do.

Additional Thought: I listen to Adam Curry’s Daily Source Code podcast, and I’ve heard him mention problems with strange characters in the OPML files used on iPodder.org. Like RSS, OPML is XML. I wonder if Dreamweaver is one of the culprits. It might not be the only problem they’re having, but I bet it’s one of them. If you’re getting weird errors validating a feed or in your OPML files, a good text editor like TextWrangler will be able to show these invisible characters. Look for things that start with ^

Rant over! Big thanks to Paul Figgiani at The Point Podcast for reporting this error and helping me to fix and test it, amongst other things. If you’re interested in getting tips on making really professional, high quality podcasts, Final Cut Pro and Macs in general, you should check out his show.

Comments are closed.