diff options
author | Marcel Hellkamp <marc@gsites.de> | 2012-06-26 00:37:48 +0200 |
---|---|---|
committer | Marcel Hellkamp <marc@gsites.de> | 2012-06-26 00:37:48 +0200 |
commit | 70c14a5491f7c12887f348ce8f7b7cfeab3e68e4 (patch) | |
tree | 760a21a584f8502565cf06006b08703bb8776580 | |
parent | c8cc11409978761194c5fce16eefeead43fb3cb1 (diff) | |
download | bottle-70c14a5491f7c12887f348ce8f7b7cfeab3e68e4.tar.gz |
docs: Typo
-rwxr-xr-x | docs/tutorial.rst | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/tutorial.rst b/docs/tutorial.rst index 0f1ee65..7b1c6fd 100755 --- a/docs/tutorial.rst +++ b/docs/tutorial.rst @@ -568,14 +568,14 @@ Here is an example for a simple file upload form: Unicode issues ----------------------- -In **Python 2** all keys and values are byte-strings. If you need unicode, you can call :meth:`FormDict.getunicode` or fetch values via attribute access. Both methods try to decode the string (default: utf8) and return an empty string if that fails. No need to catch :exc:`UnicodeError`:: +In **Python 2** all keys and values are byte-strings. If you need unicode, you can call :meth:`FormsDict.getunicode` or fetch values via attribute access. Both methods try to decode the string (default: utf8) and return an empty string if that fails. No need to catch :exc:`UnicodeError`:: >>> request.query['city'] 'G\xc3\xb6ttingen' # A utf8 byte string >>> request.query.city u'Göttingen' # The same string as unicode -In **Python 3** all strings are unicode, but HTTP is a byte-based wire protocol. The server has to decode the byte strings somehow before they are passed to the application. To be on the safe side, WSGI suggests ISO-8859-1 (aka latin1), a reversible single-byte codec that can be re-encoded with a different encoding later. Bottle does that for :meth:`FormDict.getunicode` and attribute access, but not for the dict-access methods. These return the unchanged values as provided by the server implementation, which is probably not what you want. +In **Python 3** all strings are unicode, but HTTP is a byte-based wire protocol. The server has to decode the byte strings somehow before they are passed to the application. To be on the safe side, WSGI suggests ISO-8859-1 (aka latin1), a reversible single-byte codec that can be re-encoded with a different encoding later. Bottle does that for :meth:`FormsDict.getunicode` and attribute access, but not for the dict-access methods. These return the unchanged values as provided by the server implementation, which is probably not what you want. >>> request.query['city'] 'Göttingen' # An utf8 string provisionally decoded as ISO-8859-1 by the server |