mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-10 08:38:32 +02:00
Fix Unicode encoding failure in directory export when creating filenames from journal titles with certain characters (#1090)
Fix Unicode encoding failure in directory export when creating filenames from journal titles with certain characters
This commit is contained in:
parent
046ebc7514
commit
b511461cfa
2 changed files with 20 additions and 2 deletions
|
@ -536,3 +536,21 @@ Feature: Custom formats
|
||||||
[2013-06-10 15:40] Life is good.
|
[2013-06-10 15:40] Life is good.
|
||||||
But I'm better.
|
But I'm better.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
Scenario Outline: Exporting entries with Cyrillic characters to directory should not fail
|
||||||
|
Given we use the config "<config>.yaml"
|
||||||
|
And we use the password "test" if prompted
|
||||||
|
And we create a cache directory
|
||||||
|
When we run "jrnl 2020-11-21: Первая"
|
||||||
|
When we run "jrnl --format md --file {cache_dir} -on 2020-11-21"
|
||||||
|
Then the cache should contain the files
|
||||||
|
"""
|
||||||
|
2020-11-21_первая.md
|
||||||
|
"""
|
||||||
|
|
||||||
|
Examples: configs
|
||||||
|
| config |
|
||||||
|
| basic_onefile |
|
||||||
|
| basic_encrypted |
|
||||||
|
| basic_folder |
|
||||||
|
| basic_dayone |
|
||||||
|
|
|
@ -37,8 +37,8 @@ class TextExporter:
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def make_filename(cls, entry):
|
def make_filename(cls, entry):
|
||||||
return entry.date.strftime(
|
return entry.date.strftime("%Y-%m-%d") + "_{}.{}".format(
|
||||||
"%Y-%m-%d_{}.{}".format(cls._slugify(str(entry.title)), cls.extension)
|
cls._slugify(str(entry.title)), cls.extension
|
||||||
)
|
)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|
Loading…
Add table
Reference in a new issue