Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5383

MicroPython • Re: micropython "lossy" bytes to string conversion

$
0
0
indeed they will probably be ascii
Then convert them using 'ascii' ?

I would catch the exception and then print the data to console. 'know the data !' is a prereq for a solution.

You read from a serial line ? When reading data from a serial line, then you might not have complete telegrams but only 'chunks' or even only single bytes. Will be a reliable source of decode from utf-8-errors. Are there telegram start-end markers available which allow to extract complete telegrams out of the byte stream ?

Statistics: Posted by ghp — Fri Mar 15, 2024 11:33 am



Viewing all articles
Browse latest Browse all 5383

Trending Articles