António Manuel Dias
2016-05-08 11:30:25 UTC
Hello.
I'm using Bottle 0.13 in Ubuntu 16.04 with Python 3.5.1 and the code below
was giving me problems if I entered characters with diacritical marks, like
á, é, etc. Those characters were being displayed like á and é. For
example "Cliché" was transformed in "Cliché".
The solution was to comment out the line 148 of bottle.py ("urlunquote =
functools.partial(urlunquote, encoding='latin1')"), after which the problem
disappeared.
--
António Manuel Dias
from bottle import run, route, post, request, redirect
I'm using Bottle 0.13 in Ubuntu 16.04 with Python 3.5.1 and the code below
was giving me problems if I entered characters with diacritical marks, like
á, é, etc. Those characters were being displayed like á and é. For
example "Cliché" was transformed in "Cliché".
The solution was to comment out the line 148 of bottle.py ("urlunquote =
functools.partial(urlunquote, encoding='latin1')"), after which the problem
disappeared.
--
António Manuel Dias
from bottle import run, route, post, request, redirect
@route('/')
@route('/<testinput>')
return '''<!DOCTYPE html>
<head>
<meta charset="utf-8" />
<title>Test</title>
</head>
<body>
<p>{testinput}</p>
<form action="/test" method="post">
Test input: <input name="testinput" type="text" />
<input type="submit" value="Submit" />
</form>
</body>
</html>'''.format(testinput=testinput)
@post('/test')
testinput = request.forms['testinput']
print(testinput)
redirect('/%s' % testinput)
run(host='localhost', port=8080)
--@route('/<testinput>')
return '''<!DOCTYPE html>
<head>
<meta charset="utf-8" />
<title>Test</title>
</head>
<body>
<p>{testinput}</p>
<form action="/test" method="post">
Test input: <input name="testinput" type="text" />
<input type="submit" value="Submit" />
</form>
</body>
</html>'''.format(testinput=testinput)
@post('/test')
testinput = request.forms['testinput']
print(testinput)
redirect('/%s' % testinput)
run(host='localhost', port=8080)
--
You are member of the "bottlepy" group at google groups.
See http://groups.google.de/group/bottlepy for mailing list options.
See http://bottlepy.org/ for news and documentation.
---
You received this message because you are subscribed to the Google Groups "bottlepy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bottlepy+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You are member of the "bottlepy" group at google groups.
See http://groups.google.de/group/bottlepy for mailing list options.
See http://bottlepy.org/ for news and documentation.
---
You received this message because you are subscribed to the Google Groups "bottlepy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bottlepy+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.