diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-05-29 16:25:11 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-05-29 16:25:11 -0400 |
commit | 68b74a1bf581433b59bfb1656b654018607c092d (patch) | |
tree | 552c684cff28e8417dd678d4db441b82e5da149c /mako | |
parent | d9290964f0063d5b2f04d20d3122b5811e1f47e5 (diff) | |
download | mako-68b74a1bf581433b59bfb1656b654018607c092d.tar.gz |
Switch template encoding to utf-8
The default template encoding is now utf-8. Previously, the encoding was
"ascii", which was standard throughout Python 2. This allows that
"magic encoding comment" for utf-8 templates is no longer required.
Fixes: #267
Change-Id: I411a75ebd6161e2517e06b5180a3571e5f5d923e
Diffstat (limited to 'mako')
-rw-r--r-- | mako/lexer.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mako/lexer.py b/mako/lexer.py index a02b57f..6226e26 100644 --- a/mako/lexer.py +++ b/mako/lexer.py @@ -201,7 +201,7 @@ class Lexer(object): """ if isinstance(text, compat.text_type): m = self._coding_re.match(text) - encoding = m and m.group(1) or known_encoding or "ascii" + encoding = m and m.group(1) or known_encoding or "utf-8" return encoding, text if text.startswith(codecs.BOM_UTF8): @@ -222,7 +222,7 @@ class Lexer(object): if m: parsed_encoding = m.group(1) else: - parsed_encoding = known_encoding or "ascii" + parsed_encoding = known_encoding or "utf-8" if decode_raw: try: |