command-t icon indicating copy to clipboard operation
command-t copied to clipboard

Error when Chinese characters encountered in paths

Open xiewenqi opened this issue 9 years ago • 2 comments

It seems that there is a bug when any Chinese characters contained in paths to search, the error message shows follow details:

/Users/xiewneqi/.vim/bundle/command-t/ruby/command-t/scanner/file_scanner/ruby_file_scanner.rb:31:in `join'
/Users/xiewneqi/.vim/bundle/command-t/ruby/command-t/scanner/file_scanner/ruby_file_scanner.rb:31:in `block in add_paths_for_directory'
/Users/xiewneqi/.vim/bundle/command-t/ruby/command-t/scanner/file_scanner/ruby_file_scanner.rb:29:in `foreach'
/Users/xiewneqi/.vim/bundle/command-t/ruby/command-t/scanner/file_scanner/ruby_file_scanner.rb:29:in `add_paths_for_directory'
/Users/xiewneqi/.vim/bundle/command-t/ruby/command-t/scanner/file_scanner/ruby_file_scanner.rb:13:in `paths!'
/Users/xiewneqi/.vim/bundle/command-t/ruby/command-t/scanner/file_scanner.rb:40:in `block in paths'
/Users/xiewneqi/.vim/bundle/command-t/ruby/command-t/scanner/file_scanner.rb:88:in `set_wild_ignore'
/Users/xiewneqi/.vim/bundle/command-t/ruby/command-t/scanner/file_scanner.rb:40:in `paths'
/Users/xiewneqi/.vim/bundle/command-t/ruby/command-t/finder.rb:29:in `sorted_matches_for'
/Users/xiewneqi/.vim/bundle/command-t/ruby/command-t/finder.rb:29:in `sorted_matches_for'
/Users/xiewneqi/.vim/bundle/command-t/ruby/command-t/controller.rb:261:in `list_matches'
(eval):3:in `list_matches'
/Users/xiewneqi/.vim/bundle/command-t/ruby/command-t/controller.rb:295:in `list_matches!'
/Users/xiewneqi/.vim/bundle/command-t/ruby/command-t/controller.rb:220:in `clear'
(eval):3:in `clear'
/Users/xiewneqi/.vim/bundle/command-t/ruby/command-t/controller.rb:312:in `show'
/Users/xiewneqi/.vim/bundle/command-t/ruby/command-t/controller.rb:114:in `show_file_finder'
/Users/xiewneqi/.vim/bundle/command-t/ruby/command-t/scanner/file_scanner/ruby_file_scanner.rb:31:in `join'
/Users/xiewneqi/.vim/bundle/command-t/ruby/command-t/scanner/file_scanner/ruby_file_scanner.rb:31:in `block in add_paths_for_directory'
/Users/xiewneqi/.vim/bundle/command-t/ruby/command-t/scanner/file_scanner/ruby_file_scanner.rb:29:in `foreach'
/Users/xiewneqi/.vim/bundle/command-t/ruby/command-t/scanner/file_scanner/ruby_file_scanner.rb:29:in `add_paths_for_directory'
/Users/xiewneqi/.vim/bundle/command-t/ruby/command-t/scanner/file_scanner/ruby_file_scanner.rb:13:in `paths!'
/Users/xiewneqi/.vim/bundle/command-t/ruby/command-t/scanner/file_scanner.rb:40:in `block in paths'
/Users/xiewneqi/.vim/bundle/command-t/ruby/command-t/scanner/file_scanner.rb:88:in `set_wild_ignore'
/Users/xiewneqi/.vim/bundle/command-t/ruby/command-t/scanner/file_scanner.rb:40:in `paths'
/Users/xiewneqi/.vim/bundle/command-t/ruby/command-t/finder.rb:29:in `sorted_matches_for'
/Users/xiewneqi/.vim/bundle/command-t/ruby/command-t/finder.rb:29:in `sorted_matches_for'
/Users/xiewneqi/.vim/bundle/command-t/ruby/command-t/controller.rb:261:in `list_matches'
(eval):3:in `list_matches'
/Users/xiewneqi/.vim/bundle/command-t/ruby/command-t/controller.rb:295:in `list_matches!'
/Users/xiewneqi/.vim/bundle/command-t/ruby/command-t/controller.rb:220:in `clear'
(eval):3:in `clear'
/Users/xiewneqi/.vim/bundle/command-t/ruby/command-t/controller.rb:312:in `show'
/Users/xiewneqi/.vim/bundle/command-t/ruby/command-t/controller.rb:114:in `show_file_finder'
/Users/xiewneqi/.vim/bundle/command-t/ruby/command-t/scanner/file_scanner/ruby_file_scanner.rb:31:in `join'
/Users/xiewneqi/.vim/bundle/command-t/ruby/command-t/scanner/file_scanner/ruby_file_scanner.rb:31:in `block in add_paths_for_directory'
/Users/xiewneqi/.vim/bundle/command-t/ruby/command-t/scanner/file_scanner/ruby_file_scanner.rb:29:in `foreach'
/Users/xiewneqi/.vim/bundle/command-t/ruby/command-t/scanner/file_scanner/ruby_file_scanner.rb:29:in `add_paths_for_directory'
/Users/xiewneqi/.vim/bundle/command-t/ruby/command-t/scanner/file_scanner/ruby_file_scanner.rb:13:in `paths!'
/Users/xiewneqi/.vim/bundle/command-t/ruby/command-t/scanner/file_scanner.rb:40:in `block in paths'
/Users/xiewneqi/.vim/bundle/command-t/ruby/command-t/scanner/file_scanner.rb:88:in `set_wild_ignore'
/Users/xiewneqi/.vim/bundle/command-t/ruby/command-t/scanner/file_scanner.rb:40:in `paths'
/Users/xiewneqi/.vim/bundle/command-t/ruby/command-t/finder.rb:29:in `sorted_matches_for'
/Users/xiewneqi/.vim/bundle/command-t/ruby/command-t/finder.rb:29:in `sorted_matches_for'
/Users/xiewneqi/.vim/bundle/command-t/ruby/command-t/controller.rb:261:in `list_matches'
(eval):3:in `list_matches'
/Users/xiewneqi/.vim/bundle/command-t/ruby/command-t/controller.rb:295:in `list_matches!'
/Users/xiewneqi/.vim/bundle/command-t/ruby/command-t/controller.rb:220:in `clear'
(eval):3:in `clear'
/Users/xiewneqi/.vim/bundle/command-t/ruby/command-t/controller.rb:312:in `show'
/Users/xiewneqi/.vim/bundle/command-t/ruby/command-t/controller.rb:114:in `show_file_finder'
Error detected while processing function commandt#CommandTShowFileFinder:
line    2:
Encoding::CompatibilityError: incompatible character encodings: ASCII-8BIT and UTF-8

I have declared commandT using utf-8 encoding in .vimrc: let g:CommandTEncoding='utf-8'

xiewenqi avatar Jan 03 '16 13:01 xiewenqi

Thanks for the report. Can you give me a sample path? Perhaps as a file in a zip archive so that I can try to reproduce this locally?

wincent avatar Jan 03 '16 14:01 wincent

vim资料.zip hi wincent, here is a zip archive containing several text files whose names contains Chinese characters, you can try with this.

xiewenqi avatar Jan 04 '16 12:01 xiewenqi

Given the big rewrite for v6.0.x, I'm closing all older issues as there is unlikely to be anything significant happening on the 5-x-devel branch from here on[^patches]. Feedback issue for 6.0.x is here:

  • https://github.com/wincent/command-t/issues/393

[^patches]: Patches and PRs would be welcome, but my personal efforts are going to be directed towards main.

wincent avatar Aug 26 '22 21:08 wincent