diff options
author | Shougo Matsushita <Shougo.Matsu@gmail.com> | 2017-04-04 08:24:33 +0900 |
---|---|---|
committer | Shougo Matsushita <Shougo.Matsu@gmail.com> | 2017-04-04 08:24:33 +0900 |
commit | e1e75546534df715d38ab6acb9b8a708d16cba89 (patch) | |
tree | f211ece2e613207cb1a78a435bf1885d951e631c /rplugin/python3 | |
parent | 85aa9e2dd6bcf783c222e8248197a926279634b2 (diff) | |
download | deoplete.nvim-e1e75546534df715d38ab6acb9b8a708d16cba89.zip |
Fix #456 conversion error
Diffstat (limited to 'rplugin/python3')
-rw-r--r-- | rplugin/python3/deoplete/util.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/rplugin/python3/deoplete/util.py b/rplugin/python3/deoplete/util.py index 8f51410..a7f8189 100644 --- a/rplugin/python3/deoplete/util.py +++ b/rplugin/python3/deoplete/util.py @@ -135,11 +135,12 @@ def escape(expr): def charpos2bytepos(encoding, input, pos): - return len(bytes(input[: pos], encoding)) + return len(bytes(input[: pos], encoding, errors='replace')) def bytepos2charpos(encoding, input, pos): - return len(bytes(input, encoding)[: pos].decode(encoding)) + return len(bytes(input, encoding, errors='replace')[: pos].decode( + encoding, errors='replace')) def get_custom(custom, source_name, key, default): |