Skip to content
Browse files

Encode to/decode from UTF-8 when writing/reading pages.

  • Loading branch information...
1 parent a5fcdf8 commit 2f6dc799b2c5cc219e767cef92dc6cb9927bd784 @remram44 remram44 committed Sep 18, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 wok/page.py
View
4 wok/page.py
@@ -79,7 +79,7 @@ def from_file(cls, path, options, engine, renderer=renderers.Plain):
page.filename = os.path.basename(path)
with open(path) as f:
- page.original = f.read()
+ page.original = f.read().decode('utf-8')
splits = page.original.split('\n---\n')
if len(splits) > 3:
@@ -467,7 +467,7 @@ def write(self):
logging.info('writing to {0}'.format(path))
f = open(path, 'w')
- f.write(self.rendered)
+ f.write(self.rendered.encode('utf-8'))
f.close()
def __repr__(self):

0 comments on commit 2f6dc79

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