From 4525acfb7d797eed29fdfd31b4e3ba9665851f2c Mon Sep 17 00:00:00 2001 From: N07070 Date: Tue, 14 Jan 2020 17:01:11 +0100 Subject: [PATCH] Still strying to make the encoding work --- littleprynter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/littleprynter.py b/littleprynter.py index 955751c..269fe98 100644 --- a/littleprynter.py +++ b/littleprynter.py @@ -97,7 +97,7 @@ def print_text(): printer = Adafruit_Thermal('/dev/serial0', 19200, timeout=5) printer.begin() printer.justify('L') - printer.println(request.form['message'].encode('latin-1')) + printer.println((request.form['message']).encode()) printer.setSize('S') printer.println(">> " + datetime.now().strftime("%Y-%m-%d %H:%M:%S") + " " + session.get('user')) printer.justify('C')