Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AckMate error in 1.1.2 #12

Open
ramonrails opened this issue Jun 25, 2010 · 15 comments
Open

AckMate error in 1.1.2 #12

ramonrails opened this issue Jun 25, 2010 · 15 comments

Comments

@ramonrails
Copy link

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

@protocool
Copy link
Owner

what's the file encoding of the file you're searching?

@ramonrails
Copy link
Author

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.

@protocool
Copy link
Owner

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

@ramonrails
Copy link
Author

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.

@ramonrails
Copy link
Author

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.

@krikis
Copy link

krikis commented Jul 8, 2010

@ 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

@ramonrails
Copy link
Author

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.

@spovich
Copy link

spovich commented Jul 13, 2010

+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!

@jjb
Copy link

jjb commented Jul 27, 2010

the formatting in krikis's solution above got messed up, it should be:

--type-set=bin=.pdf
--nobin

(and it worked for me)

@rvega
Copy link

rvega commented Jan 12, 2011

+1

@vosechu
Copy link

vosechu commented May 26, 2011

@krikis, thanks for your fix. That works for me.

@jjb
Copy link

jjb commented May 28, 2011

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

@vosechu
Copy link

vosechu commented Jun 1, 2011

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)

@vosechu
Copy link

vosechu commented Jun 1, 2011

shit. Nm. It's a wiki.

@2called-chaos
Copy link

--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 {}\""

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants