unite-everything icon indicating copy to clipboard operation
unite-everything copied to clipboard

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

Open hongyuanjia opened this issue 8 years ago • 3 comments

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.

hongyuanjia avatar Aug 26 '16 17:08 hongyuanjia

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.

sgur avatar Aug 29 '16 02:08 sgur

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 avatar Aug 29 '16 03:08 hongyuanjia

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.

hongyuanjia avatar Aug 29 '16 03:08 hongyuanjia