summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@tilaajavastuu.fi>2015-02-10 10:44:41 +0200
committerLars Wirzenius <liw@liw.fi>2015-02-10 13:09:26 +0200
commit93471e250ef13612ff2b5aadcf0c2083aa762cc0 (patch)
treecec0d1b90fef83ca5929b2725c350195e2c41444
parent10d0192fa79b79667d6561e43660e1aac5449b0d (diff)
downloadcmdtest-93471e250ef13612ff2b5aadcf0c2083aa762cc0.tar.gz
Support utf-8 input
-rw-r--r--NEWS3
-rw-r--r--simple.scenario2
-rw-r--r--yarnlib/mdparser.py5
3 files changed, 8 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index 093c6b8..8221d58 100644
--- a/NEWS
+++ b/NEWS
@@ -9,6 +9,9 @@ Version 0.14, released UNRELEASED
* Yarn now supports continuation lines: start a line with `...` and it
continues the previous line.
+* Yarn now works with UTF-8 input. No other character sets are
+ supported; sorry (but patches welcome).
+
Version 0.12, released 2014-03-28
---------------------------------
diff --git a/simple.scenario b/simple.scenario
index a244d88..a8bc7bb 100644
--- a/simple.scenario
+++ b/simple.scenario
@@ -15,6 +15,8 @@ The following is the actual test in this scenario:
AND not all is well
FINALLY cleanup
+We also support some non-ASCII text: älämölö.
+
And the implementations follow.
IMPLEMENTS GIVEN a clean slate
diff --git a/yarnlib/mdparser.py b/yarnlib/mdparser.py
index f787293..4bd59d3 100644
--- a/yarnlib/mdparser.py
+++ b/yarnlib/mdparser.py
@@ -72,5 +72,6 @@ class MarkdownParser(object):
def parse_file(self, filename): # pragma: no cover
with open(filename) as f:
- return self.parse_string(f.read())
-
+ binary = f.read()
+ text = binary.decode('utf-8')
+ return self.parse_string(text)