Comments (7)
Thank you for the minimal reproducer! I found the issue - the strings are both unicode but are composed differently:
>>> s1 = 'Erträgnisaufstellung' # copied from config.yaml
>>> s2 = 'Erträgnisaufstellung' # copied from filename
>>> s1.encode('utf-8')
b'Ertr\xc3\xa4gnisaufstellung'
>>> s2.encode('utf-8')
b'Ertra\xcc\x88gnisaufstellung'
To be honest, this sent me down a rabbit hole. It seems like the HFS+ filesystem saves filenames in UTF-8 in NFD (decomposed) form and in your config you wrote the NFC (precomposed) form.
The form on NFS filesystems is not specified and filenames on samba shares and in linux seem to be in NFC. APFS does not enforce a normalization as far as I know.
I guess using the NFKD form internally for all comparisons would behave like expected for most use cases. This means rolling my own unicode-normalized glob implementation and normalizing the config before parsing. This is now on my todo-list but might take a while because it needs to be tested on different platforms. I'm really wondering why python doesn't simplify these things for you :/
from organize.
Hi, thank you for the detailed report. Unfortunately I'm not able to reproduce this - it works for me on both windows 10 and macOS :/
- Can you check whether your config.yaml is UTF-8 encoded? Or even better send the original file via email (address is in my profile)
- Can you try retyping the filename by hand and check again? UTF-8 has some identical looking, confusable characters, maybe your
ä
is really an𝚊̈
(https://unicode.org/cldr/utility/confusables.jsp?a=ä&r=None)
from organize.
I think the encoding of the config file is correct and I tried both versions of the confusables again, but with no luck. I will send you an email with an example file and config.
from organize.
In the meantime you can copy your filename into your config file and everything should work 👌
from organize.
Hi Thomas, sorry for the ultra late reply!
This is indeed a rabbit hole! Never heard of the confusables before, but it is good to know. I remember that I tried to copy the filename, but that did not work either.
As I tested it now it works though. I guess this has sth. to do with these confusables. The original 'ä' in the PDF from my bank was probably a different one than the 'ä' I type on my Mac and after fiddling around with renaming and adjusting the config a couple of times, the original 'ä' probably disappeared.
Thanks for clearing that up and thanks for providing organize!
from organize.
Hey thank you so much for the kind words and for the donation! It's very much appreciated!
from organize.
This is now fixed and will be available in the next version 👍
from organize.
Related Issues (20)
- Avoiding 0-byte files being created when encountering "No space left on device" HOT 4
- Move action deletes file info HOT 1
- Filenames with square brackets ignored HOT 2
- `assert` is missing in test_extension.py HOT 1
- Can't use actions, even if copied rules from documentation HOT 12
- Consistent chronological order Issue in File Renaming HOT 6
- rename action error: ERROR! Missing value for template: 'builtin_function_or_method object' has no attribute 'strftime' HOT 3
- Original Name Variable Issue in Move and Rename Operation HOT 3
- Error: Config problem HOT 4
- Integration of Third-Party Plugin Interface HOT 1
- XDG_CONFIG_HOME ignored by default on macOS HOT 2
- Include multiple actions and mix move and shell crashes organize-tool HOT 3
- Moving a file to a NAS server triggers an error HOT 10
- Have Organize start up and stay running for interaction at the command line, (rather than run a config.yml and close)? HOT 5
- Skipped files / Silent Error / Lack of verbose run HOT 7
- macos_tags problem HOT 5
- Renaming files HOT 5
- Copy folder structure from parent folder, monitored folder, or root folder HOT 4
- Persist logs HOT 1
- Remove macOS tags
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from organize.