Open ramonrails opened 14 years ago
what's the file encoding of the file you're searching?
Mine is set to UTF8 with LF line endings (also for existing files)
For a faster response or interaction, please find me as ramonrails on any major IM channel. I am online now, if you like to discuss.
Sorry, I have no time to walk through your issue over IM.
All I can say is that perl is complaining that it's encountering files that aren't utf8 encoded.
Version 1.1.2 expects everything to be utf8 so that it can correctly match characters rather than bytes.
I'm sure you're as busy as I am so I won't ask you to try and track down which files in your tree are causing it to choke (the first couple of errors occur at line numbers that indicate one of the offending files is non-binary and has no extension), but if you happen to discover it, having an example would help me to address the issue.
In the mean-time, your best bet is to install 1.1.1 and wait until I add an option to turn of utf8 searching on a per-project basis.
Regards, Trev
this project has files from the client checked into git repo. the project is also about 4 years old. I will see if I can find time to track the non-utf8 files and fix them (unless limited by some factor)
One feature request: switching off UTF8 sound good. Can you maybe also display the list of files that are not UTF8? That may help users to track the files easily and see if they can re-encode it to UTF8. Should be simple since you already have the file loaded for searching, collecting its name would be simple, I presume.
I professionally work only with ruby based apps. I would love to submit some patches in Obj-C when I can find some time. Need to learn it first :o)
Thanks for the quick update anyways. Sincerely appreciated.
I was in-fact thinking of "helping you walk through the issue to find a solution faster". Not "helping me to walk-through the problem" :o)
I already switched to 1.1.1 immediately after the error. Cannot afford to lose time. But, I can always take some time out to help in any way I can for an awesome piece of work you have done so far. Very fast searches!
Many thanks.
@ ramonrails
I solved this problem as follows. I opened ackmate_ack in mate mate /Users/samuel/Library/Application\ Support/TextMate/PlugIns/AckMate.tmplugin/Contents/Resources/ackmate_ack and added this on line 1560 App::Ack::warn( "$filename" ); Then I did a search. At the end of the search output, all searched files are now listed and the ones followed by the error you mentioned are the ones that are not UTF8 encoded.
In my case it turned out these were .pdf files. By simply adding --type-set=bin=.pdf --nobin to my ~/.ackrc file, the problem was solved.
Hope this works for you (And don't forget to remove the App::Ack::warn( "$filename" ); line when you're done :P)
Cheers,
Samuel
That did not work for me. I have a lot of files in the project that I do not wish to touch just for this sake.
+1 for an option to turn-off UTF-8 searching. I have some included libraries that have hundreds of 'problems' with UTF-8 encoding, so using 1.1.1 for now.
Thanks for AckMate! Awesome stuff!
the formatting in krikis's solution above got messed up, it should be:
--type-set=bin=.pdf
--nobin
(and it worked for me)
+1
@krikis, thanks for your fix. That works for me.
Alright folks, I've put together a solution for reporting offending files. Tell me what you think: https://github.com/protocool/AckMate/wiki/Unicode-UTF-8-error-message
Thanks jjb. Can you add a comment about what to do with the files in the wiki (adding the nobin option, doing the type-set thing)
shit. Nm. It's a wiki.
--nobinary
--type-set=bin=.pdf,.csv
--nobin
--ignore-dir=.git
Worked for me but maybe it would work without the git line too. And a nice and awesome snippet to get a list of non utf-8 files:
find . -type f | xargs -I {} bash -c "iconv -f utf-8 -t utf-16 {} &>/dev/null || echo {}"
and I added this directly as an alias:
alias utf8_fail="find . -type f | xargs -I {} bash -c \"iconv -f utf-8 -t utf-16 {} &>/dev/null || echo {}\""
Please check this error. I was not able to copy the text, so pasted screenshot. http://img63.imageshack.us/img63/2135/ackmate112error.jpg
the same search worked with 1.1.1