Improve UTF-8 handling in avrorouter

The json_stringn function should be used instead of the json_string to
allow null characters as well as non-null terminated strings to be
embedded in the JSON values.

The CDC example Python programs now decode the data as UTF-8 instead of
ASCII.
This commit is contained in:
Markus Mäkelä
2017-03-15 11:38:12 +02:00
parent 67590d59ac
commit 3396741c21
6 changed files with 11 additions and 8 deletions

View File

@ -52,4 +52,4 @@ else:
sock.send(bytes("QUERY-LAST-TRANSACTION".encode()))
response = sock.recv(1024)
print(response.decode('ascii'))
print(response.decode('utf_8'))