[chronojump-server] main.py tring to download Response with accents



commit e359f81375ed688cb2e668948d5068bcdf7bfe97
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon Jun 26 23:00:45 2017 +0200

    main.py tring to download Response with accents

 main.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/main.py b/main.py
index fa420aa..7900676 100755
--- a/main.py
+++ b/main.py
@@ -117,7 +117,10 @@ def getPersonByRFID():
     assert len(people) >= 1
 
     # TODO: handle if len(people) == 0 (rfid not found)
-    return Response(json.dumps(people[0]))
+    return Response(json.dumps(people[0])) #This cannot download accents (latin chars)
+#    return Response(json.dumps(people[0], ensure_ascii=False)) #download 'alternative' chars
+#    return Response(json.dumps(people[0], ensure_ascii=False).encode('utf8')) #This crashes
+#    return Response(json.dumps(people[0], ensure_ascii=False, encode('utf8'))) #does not compile
 
 @app.route("/getTasks", methods=['POST'])
 @auto.doc()


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]