Skip to content
This repository
Browse code

Some tiny documentation fixes (unicode -> Unicode)

--HG--
branch : trunk
  • Loading branch information...
commit 656d5e7c315c462eff219bc45926376759b25364 1 parent 88dc32c
Armin Ronacher authored

Showing 2 changed files with 10 additions and 10 deletions. Show diff stats Hide diff stats

  1. +9 9 docs/api.rst
  2. +1 1  docs/intro.rst
18 docs/api.rst
Source Rendered
@@ -52,7 +52,7 @@ a lot easier to use it also enables template inheritance.
52 52 Unicode
53 53 -------
54 54
55   -Jinja2 is using unicode internally which means that you have to pass unicode
  55 +Jinja2 is using Unicode internally which means that you have to pass Unicode
56 56 objects to the render function or bytestrings that only consist of ASCII
57 57 characters. Additionally newlines are normalized to one end of line
58 58 sequence which is per default UNIX style (``\n``).
@@ -64,14 +64,14 @@ be used to store text based information unless only ASCII characters are
64 64 used. With Python 2.6 it is possible to make `unicode` the default on a per
65 65 module level and with Python 3 it will be the default.
66 66
67   -To explicitly use a unicode string you have to prefix the string literal
  67 +To explicitly use a Unicode string you have to prefix the string literal
68 68 with a `u`: ``u'Hänsel und Gretel sagen Hallo'``. That way Python will
69   -store the string as unicode by decoding the string with the character
  69 +store the string as Unicode by decoding the string with the character
70 70 encoding from the current Python module. If no encoding is specified this
71 71 defaults to 'ASCII' which means that you can't use any non ASCII identifier.
72 72
73 73 To set a better module encoding add the following comment to the first or
74   -second line of the Python module using the unicode literal::
  74 +second line of the Python module using the Unicode literal::
75 75
76 76 # -*- coding: utf-8 -*-
77 77
@@ -80,20 +80,20 @@ possible to represent every Unicode character in utf-8 and because it's
80 80 backwards compatible to ASCII. For Jinja2 the default encoding of templates
81 81 is assumed to be utf-8.
82 82
83   -It is not possible to use Jinja2 to process non unicode data. The reason
  83 +It is not possible to use Jinja2 to process non-Unicode data. The reason
84 84 for this is that Jinja2 uses Unicode already on the language level. For
85 85 example Jinja2 treats the non-breaking space as valid whitespace inside
86 86 expressions which requires knowledge of the encoding or operating on an
87   -unicode string.
  87 +Unicode string.
88 88
89   -For more details about unicode in Python have a look at the excellent
  89 +For more details about Unicode in Python have a look at the excellent
90 90 `Unicode documentation`_.
91 91
92 92 Another important thing is how Jinja2 is handling string literals in
93   -templates. A naive implementation would be using unicode strings for
  93 +templates. A naive implementation would be using Unicode strings for
94 94 all string literals but it turned out in the past that this is problematic
95 95 as some libraries are typechecking against `str` explicitly. For example
96   -`datetime.strftime` does not accept unicode arguments. To not break it
  96 +`datetime.strftime` does not accept Unicode arguments. To not break it
97 97 completely Jinja2 is returning `str` for strings that fit into ASCII and
98 98 for everything else `unicode`:
99 99
2  docs/intro.rst
Source Rendered
@@ -37,7 +37,7 @@ that can create python extensions should be installed for the debugger. If no
37 37 C-compiler is available and you are using Python 2.4 the `ctypes`_ module
38 38 should be installed.
39 39
40   -If you don't have a working C compiler and you are trying to install the source
  40 +If you don't have a working C-compiler and you are trying to install the source
41 41 release with the speedups you will get a compiler error. This however can be
42 42 circumvented by passing the ``--without-speedups`` command line argument to the
43 43 setup script::

0 comments on commit 656d5e7

Please sign in to comment.
Something went wrong with that request. Please try again.