Closed xrayw closed 6 years ago
What error?
Could you post more informaton, including the reproducing steps.
I don't have a Windows currently, and I cannot reproduce it on my vim8.
@roxma Thanks for your reply.
To reproduce this bug:
Write a Chinese character, and i got it.
en. There are more information in log file, and I can't catch the point. Or I send the log file to your email?
Use gist or paste bin for pasting log file.
What's the error shown on the screen?
I also need the result of set encoding
and set fileencoding
after you openning the buffer
And a minimal vimrc for reproducing the error.
I can reproduce the error on my laptop with set encoding=cp936
vimrc:
set nocompatible
syntax on
filetype plugin indent on
set encoding=utf-8 fileencodings=ucs-bom,utf-8,gbk,gb18030,latin1 termencoding=utf-8
call plug#begin(expand('<sfile>:h') . '/plugged/')
Plug 'roxma/nvim-completion-manager'
if !has('nvim')
Plug 'roxma/vim-hug-neovim-rpc'
endif
call plug#end()
set encoding=cp936
It's working fine with set encoding=utf-8
The screen:
\
vimrc:
set nocompatible
set encoding=utf-8
set fileencoding=utf-8
set fileencodings=utf8,cp936,ucs-bom,latin1,chinese
call plug#begin('$VIM/vimfiles/plugged')
Plug 'roxma/nvim-completion-manager'
if !has('nvim')
Plug 'roxma/vim-hug-neovim-rpc'
endif
call plug#end()
But I can't reproduce the error with the mini vimrc. It seems other setting caused it, I'll check my configuration, And test it on mac.
thanks for your help.
It's wierd that python is executing code in encodings\cp1252.py
What's the result of
:python3 print(sys.getdefaultencoding())
:python3 print(sys.getfilesystemencoding())
:python3 import locale; print(locale.getpreferredencoding())
Interesting:
>>> "\u5f00"
'开'
>>> "\u5f00".encode('cp1252')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/rh/rh-python35/root/usr/lib64/python3.5/encodings/cp1252.py", line 12, in encode
return codecs.charmap_encode(input,errors,encoding_table)
UnicodeEncodeError: 'charmap' codec can't encode character '\u5f00' in position 0: character maps to <undefined>
>>> "\u5f00".encode('cp936')
b'\xbf\xaa'
>>>
>>> "\u86e4"
'蛤'
>>> "\u86e4".encode('cp1252')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/rh/rh-python35/root/usr/lib64/python3.5/encodings/cp1252.py", line 12, in encode
return codecs.charmap_encode(input,errors,encoding_table)
UnicodeEncodeError: 'charmap' codec can't encode character '\u86e4' in position 0: character maps to <undefined>
My guess: Replacing your python installation with python 3.6 or higher will fix this issue.
:python3 print(sys.getdefaultencoding())
=> utf-8:python3 print(sys.getfilesystemencoding())
=> mbcs:python3 import locale; print(locale.getpreferredencoding())
=> cp1252It works fine on Mac.
The screenshot you posted is triggered by logging.
What does it look like without enabling logging?
Oh, I can't reproduce the bug now.
It seems caused by logging, When I re-enable the logging configuration of NCM, It repeared again.
And shown logging error :
Ok. Update vim-hug-neovim-rpc to the latest version.
And let's wait for the next release of neovim python client. // https://github.com/neovim/python-client/pull/276
// cc @justinmk
It is 100% appear on my machine. Have you ever had the same situation?