request.query['q'] and forms.get('q') return the original byte value sent by the web browser. The äöü value sent by the browser as UTF-8 encoded bytes is '\xc3\xa4\xc3\xb6\xc3\xbc' .
If you print this byte string and the place you print to interpret it as ISO-8859-1 or a similar Windows 1252 code page, you will get äöü . If you are debugging by printing on the Windows command line or the file displayed by Notepad, then why.
If you use alternative direct access to request.query.q or forms.q , the Bottle instead produces Unicode strings decoded from the byte version using UTF-8. It is usually best to work with these Unicode strings wherever possible. (Although you may still have problems printing them on the console. The Windows command line, as you know, does a terrible job at non-ASCII characters, and as such is a bad place to debug Unicode problems.)
source share