protocool / AckMate

TextMate plugin (Cocoa) shell for running 'ack'
MIT License
723 stars 34 forks source link

Error at EOF? #16

Open oliverl opened 13 years ago

oliverl commented 13 years ago

see these errors in red. often.

utf8 "\xD1" does not map to Unicode at /Users/../Contents/Resources/ackmate_ack line 1560, <$fh> line 1. Malformed UTF-8 character (unexpected non-continuation byte 0x20, immediately after start byte 0xd1) in pattern match (m//) at /Users/../Contents/Resources/ackmate_ack line 1568.

protocool commented 13 years ago

There are files in your tree that aren't utf8 encoded.

If you need to be able to search for extended characters then you need to make sure all of your files are actually utf8 encoded.

If you don't need to search for extended characters then switch back to AckMate 1.1.1 for the time being. When I get time I'll look for a way to improve handling of extended characters so that it works correctly in all situations. Failing that, I'll rip out the utf8 support entirely.

oliverl commented 13 years ago

thx! perhaps is choking on our sql backup? is there a way of explicitly instructing ackmate to ignore certain file extensions or directories?

protocool commented 13 years ago

Indeed there is - the simplest is to tell it to ignore based on file type (extension).

See http://github.com/protocool/AckMate/wiki where I give an example that configures .xib files (so that I can search them) but leaves them ignored by default.

It gets a bit tricker if you have source files called something.sql that you do want to search, but you also have backup files with the same .sql extension that you want to ignore.

In that case, you have to try to ignore based on directory names.

By default, ack can ignore named directories but not named paths. Which is to say, it can ignore all .svn directories, but you can't say "just ignore ~/deeply/nested/path/.svn".

So in the 'options' field in the AckMate you could specify --ignore-dir=backups or you could put that (on its own line) in your $HOME/.ackrc to have it standard across all of your ack searches.

Another option is that AckMate tries to use TextMate's "folder references" feature for ignoring specific paths in your project.

Unfortunately AckMate only has access to the global folder-refrences (from Preferences) so any per-project ones you have set up are unavailable.

Hope this helps.

parkr commented 12 years ago

I see these too, but I do not know what files cause this. Is there a way for me to do this?

I get a HUGE list of these errors, too. Even when excluding what I think might be the problem directories. Always appears at the bottom of the search results, like this:

Problems with encoding