Merge pull request #163 from maebert/fix-162

Fix 162
This commit is contained in:
Manuel Ebert 2014-05-19 14:47:44 -07:00
commit 0961aa7610
3 changed files with 5 additions and 3 deletions

View file

@ -4,6 +4,7 @@ Changelog
### 1.7 (December 22, 2013) ### 1.7 (December 22, 2013)
* __1.7.22__ Fixed an issue with writing files when exporting entries containing non-ascii characters.
* __1.7.21__ jrnl now uses PKCS#7 padding. * __1.7.21__ jrnl now uses PKCS#7 padding.
* __1.7.20__ Minor fixes when parsing DayOne journals * __1.7.20__ Minor fixes when parsing DayOne journals
* __1.7.19__ Creates full path to journal during installation if it doesn't exist yet * __1.7.19__ Creates full path to journal during installation if it doesn't exist yet

View file

@ -8,7 +8,7 @@ jrnl is a simple journal application for your command line.
from __future__ import absolute_import from __future__ import absolute_import
__title__ = 'jrnl' __title__ = 'jrnl'
__version__ = '1.7.21' __version__ = '1.7.22'
__author__ = 'Manuel Ebert' __author__ = 'Manuel Ebert'
__license__ = 'MIT License' __license__ = 'MIT License'
__copyright__ = 'Copyright 2013 - 2014 Manuel Ebert' __copyright__ = 'Copyright 2013 - 2014 Manuel Ebert'

View file

@ -5,6 +5,7 @@ from __future__ import absolute_import
import os import os
import json import json
from .util import u, slugify from .util import u, slugify
import codecs
def get_tags_count(journal): def get_tags_count(journal):
@ -81,7 +82,7 @@ def export(journal, format, output=None):
content = maps[format](journal) content = maps[format](journal)
if output: if output:
try: try:
with open(output, 'w') as f: with codecs.open(output, "w", "utf-8") as f:
f.write(content) f.write(content)
return "[Journal exported to {0}]".format(output) return "[Journal exported to {0}]".format(output)
except IOError as e: except IOError as e:
@ -101,6 +102,6 @@ def write_files(journal, path, format):
content = e.to_md() content = e.to_md()
elif format == 'txt': elif format == 'txt':
content = u(e) content = u(e)
with open(full_path, 'w') as f: with codecs.open(full_path, "w", "utf-8") as f:
f.write(content) f.write(content)
return "[Journal exported individual files in {0}]".format(path) return "[Journal exported individual files in {0}]".format(path)