On Mar 20, 2006, at 4:51 PM, Chris Thomas wrote:
Has anyone written a "zap gremlins" command for TextMate? BBEdit has this, but an equivalent doesn't seem to be available in TextMate. Thanks,
Text > Remove Unprintable Characters in Document
Ah, thanks for the pointer. I completely missed that.
Unfortunately, it doesn't work. That is, it doesn't work like BBEdit's Zap Gremlins. The problem is that TextMate's version is too conservative. With Zap Gremlins, I have the option of removing any non-ASCII characters, while TextMate only removes "unprintable" characters. A case in point:
http://vocaro.com/trevor/files/t.cc
Compiling the above in g++ gives: t.cc:8: error: stray '\194' in program t.cc:8: error: stray '\160' in program
The problem characters are 0xC2 and 0xA0, which apparently are "printable" (according to TextMate) but are not compilable.
Perhaps we simply need an extra command: "Remove non-ASCII Characters in Document".
Trevor