From adb091808b999fe5b6d3941bd5043ca861934b29 Mon Sep 17 00:00:00 2001 From: Adrian Castravete Date: Tue, 29 May 2018 15:38:36 +0300 Subject: [PATCH] BUG: Fix handling of encoding for the StataReader #21244 --- pandas/io/stata.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/io/stata.py b/pandas/io/stata.py index 8f91c7a497e2d0..269047c28b54ba 100644 --- a/pandas/io/stata.py +++ b/pandas/io/stata.py @@ -1335,7 +1335,7 @@ def _calcsize(self, fmt): def _decode(self, s): s = s.partition(b"\0")[0] - return s.decode('utf-8') + return s.decode(self._encoding or self._default_encoding) def _null_terminate(self, s): if compat.PY3 or self._encoding is not None: