From 173bb308966865f75a725c927b7fbbccc80afbca Mon Sep 17 00:00:00 2001 From: Shougo Date: Wed, 19 Feb 2020 07:52:02 +0900 Subject: [PATCH] Revert "Remove `encoding` and `unicode_errors` option from Packer and Unpacker" --- rplugin/python3/deoplete/child.py | 5 ++++- rplugin/python3/deoplete/parent.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/rplugin/python3/deoplete/child.py b/rplugin/python3/deoplete/child.py index 842755ac..484a5551 100644 --- a/rplugin/python3/deoplete/child.py +++ b/rplugin/python3/deoplete/child.py @@ -40,9 +40,12 @@ def __init__(self, vim: Nvim) -> None: self._source_errors: typing.Dict[str, int] = defaultdict(int) self._prev_results: typing.Dict[str, Result] = {} self._unpacker = msgpack.Unpacker( + encoding='utf-8', unicode_errors='surrogateescape') self._packer = msgpack.Packer( - use_bin_type=True) + use_bin_type=True, + encoding='utf-8', + unicode_errors='surrogateescape') self._ignore_sources: typing.List[typing.Any] = [] def main_loop(self, stdout: typing.Any) -> None: diff --git a/rplugin/python3/deoplete/parent.py b/rplugin/python3/deoplete/parent.py index 01f92e27..72438b82 100644 --- a/rplugin/python3/deoplete/parent.py +++ b/rplugin/python3/deoplete/parent.py @@ -118,8 +118,11 @@ def _start_process(self) -> None: self._queue_out: Queue = Queue() # type: ignore self._queue_err: Queue = Queue() # type: ignore self._packer = msgpack.Packer( - use_bin_type=True) + use_bin_type=True, + encoding='utf-8', + unicode_errors='surrogateescape') self._unpacker = msgpack.Unpacker( + encoding='utf-8', unicode_errors='surrogateescape') self._prev_pos: typing.List[typing.Any] = []