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

Only return hexadecimal strings in search results when folder or file names contain Chinese characters #5

Open
hongyuanjia opened this issue Aug 26, 2016 · 3 comments
Assignees

Comments

@hongyuanjia
Copy link

Many thanks for this great plugin!

I ran into a problem that whenever there are Chinese characters in my folder or file names, they will be displayed as hexadecimal strings such as <c8><ed><bc><fe>, and when I try to open one of the files, vim will always generate a new file named with those hexadecimal strings.

I think it is an encoding issue. In my _vimrc, I set the default encoding to utf-8. It works fine with all other unite source plugins such as unite-outline, vimfiler, unite-help, and unite-session and all Chinese characters are displayed correctly.

I try to set the unite-everything buffer encoding into cp936 (a character encoding for Simplified Chinese) using :set encoding=cp936, then the Chinese characters come out but the characters in the tabline goes into a mess.

Any insights of how to solve this issues? Thanks again for this great plugin.

@sgur
Copy link
Owner

sgur commented Aug 29, 2016

Hi,

This issue is caused by the output encodings between vim and the output of everything process as you supposed.
Output encoding is converted at autoload/unite/sources/everything.vim#L134
and autoload/unite/sources/everything.vim#L148 but it seems insufficient in this case.

I try to set the unite-everything buffer encoding into cp936 (a character encoding for Simplified Chinese) using :set encoding=cp936, then the Chinese characters come out but the characters in the tabline goes into a mess.

It seems good to set fileencoding instead of encoding to change buffer encoding.

@hongyuanjia
Copy link
Author

I tried to run :set fileencoding=cp936 but vim returned E21: Cannot make changes, 'modifiable' is off: fileencoding=cp936. Then after I set :set ma, and run :set fileencoding=cp936 again, nothing changes.

Any advice?

@hongyuanjia
Copy link
Author

Actually, before I submitted this issue, I tried to change the everything.vim code as you said. Because of my poor knowledge of vimscript, I failed to find a workaround.

@sgur sgur assigned sgur Sep 9, 2016
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

2 participants