Update binary_reader.py

It fix read unicode string (issue #49)
This commit is contained in:
Gholamhossein Tavasoli 2017-05-03 11:24:59 +04:30 committed by GitHub
parent 3d66062eb4
commit 649620af1d

View File

@ -89,7 +89,7 @@ class BinaryReader:
def tgread_string(self):
"""Reads a Telegram-encoded string"""
return self._decode_string(self.tgread_bytes())
return str(self.tgread_bytes(), encoding='utf-8', errors='replace')
@staticmethod
def _decode_string(encoded):