From c777eeb985a8f4c2dfa4ca208c973b436d5cf0e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20Fernando=20S=C3=A1nchez?= Date: Wed, 25 Feb 2015 15:37:47 -0500 Subject: [PATCH 1/2] --- server.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 server.py diff --git a/server.py b/server.py new file mode 100644 index 0000000..a28af53 --- /dev/null +++ b/server.py @@ -0,0 +1,15 @@ +#!/usr/bin/python +from flask import Flask, request, Markup + +app = Flask("prueba") + +@app.route("/") +def home(): + args = ("
")
+    for i in request.args:
+        a = request.args[i]
+        args += u"{} [{}]: {}\n".format(i, Markup.escape(str(type(a))), a)
+    args += "
" + return args + +app.run(debug=True) From f223e351402a52e6480d962ed72b31afa453b683 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20Fernando=20S=C3=A1nchez?= Date: Wed, 25 Feb 2015 12:46:09 -0800 Subject: [PATCH 2/2] --- coding.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 coding.py diff --git a/coding.py b/coding.py new file mode 100644 index 0000000..0d05452 --- /dev/null +++ b/coding.py @@ -0,0 +1,9 @@ +a = u"codificación" +print a # u"codificación" +print type(a) # +b = a.encode("utf-8") +print b # codificación # But it depends on your terminal settings +print type(b) # +c = b.decode("utf-8") +print type(c) # +print c # u"codificación" \ No newline at end of file