diff options
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): |