summaryrefslogtreecommitdiff
path: root/rplugin/python3
diff options
context:
space:
mode:
authorShougo Matsushita <Shougo.Matsu@gmail.com>2017-04-04 08:24:33 +0900
committerShougo Matsushita <Shougo.Matsu@gmail.com>2017-04-04 08:24:33 +0900
commite1e75546534df715d38ab6acb9b8a708d16cba89 (patch)
treef211ece2e613207cb1a78a435bf1885d951e631c /rplugin/python3
parent85aa9e2dd6bcf783c222e8248197a926279634b2 (diff)
downloaddeoplete.nvim-e1e75546534df715d38ab6acb9b8a708d16cba89.zip
Fix #456 conversion error
Diffstat (limited to 'rplugin/python3')
-rw-r--r--rplugin/python3/deoplete/util.py5
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):