Merge branch 'bugfix/monitor_win_encoding' into 'master'
idf_monitor: Fix Unicode decoding on Windows See merge request idf/esp-idf!3157
This commit is contained in:
commit
4197ee746a
1 changed files with 4 additions and 2 deletions
|
@ -733,8 +733,10 @@ if os.name == 'nt':
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def write(self, data):
|
def write(self, data):
|
||||||
if type(data) is not bytes:
|
if isinstance(data, bytes):
|
||||||
data = data.encode('latin-1')
|
data = bytearray(data)
|
||||||
|
else:
|
||||||
|
data = bytearray(data, 'utf-8')
|
||||||
for b in data:
|
for b in data:
|
||||||
b = bytes([b])
|
b = bytes([b])
|
||||||
l = len(self.matched)
|
l = len(self.matched)
|
||||||
|
|
Loading…
Reference in a new issue