mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-10 16:48:31 +02:00
parent
cd96b37ec7
commit
7c72a98c00
1 changed files with 3 additions and 2 deletions
|
@ -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)
|
||||||
|
|
Loading…
Add table
Reference in a new issue