Fix typos
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by florentx · committed by Armin Ronacher · parent f694456 · Browse files · 2 files·+7 added−7 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
2 files+7 added−7 removed
- other:+7 added−7 removed
Provenance
- Commit
31d3596- Tree
c2abb85- Author
florentx <florent.xicluna@gmail.com>- Committer
Armin Ronacher <armin.ronacher@active-4.com>- Parent
f694456
2 files changed+7 added−7 removed
deleted:docs/_themesnot shown
Its text is not shown, deleted.
modified:docs/unicode.rst+7 added-7 removed
6 unmodified lines7 should probably read `The Absolute Minimum Every Software Developer8 Absolutely, Positively Must Know About Unicode and Character Sets9 <http://www.joelonsoftware.com/articles/Unicode.html>`_. This part of the10 documentation just tries to cover the very basics so that you have a11-pleasent experience with unicode related things.11+pleasant experience with unicode related things.12 13 Automatic Conversion14 --------------------15 37 unmodified lines53 to tell Python which encoding your file uses. Again, I recommend54 UTF-8 for this purpose. To tell the interpreter your encoding you can55 put the ``# -*- coding: utf-8 -*-`` into the first or second line of56 your Python source file.57-- Jinja is configured to decode the template files from UTF08. So make57+- Jinja is configured to decode the template files from UTF-8. So make58 sure to tell your editor to save the file as UTF-8 there as well.59 60 Encoding and Decoding Yourself61 ------------------------------62 63 If you are talking with a filesystem or something that is not really based64 on unicode you will have to ensure that you decode properly when working65 with unicode interface. So for example if you want to load a file on the66-filesystem and embedd it into a Jinja2 template you will have to decode it67-form the encoding of that file. Here the old problem that textfiles do66+filesystem and embed it into a Jinja2 template you will have to decode it67+from the encoding of that file. Here the old problem that text files do68 not specify their encoding comes into play. So do yourself a favour and69-limit yourself to UTF-8 for textfiles as well.69+limit yourself to UTF-8 for text files as well.70 71-Anyways. To load such a file with unicode you can use the builtin71+Anyways. To load such a file with unicode you can use the built-in72 :meth:`str.decode` method::73 74 def read_file(filename, charset='utf-8'):75 with open(filename, 'r') as f:27 unmodified lines103 2. Select the "New Document/Default Directory" tab104 3. Select "UTF-8 without BOM" as encoding105 106 It is also recommended to use the Unix newline format, you can select107- it in the same panel but this not a requirement.107+ it in the same panel but this is not a requirement.