Does the "Remove Unprintable Characters in Document" command take into consideration the character encoding of the file? In a brief experiment with the supplied file I found that in some encodings the byte sequences was printed, but in others (UTF-8) the byte sequence was not printed.
-Corey
On 3/20/06, Trevor Harmon trevor@vocaro.com wrote:
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
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
-- -Corey O'Connor