Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add options for specifying unicode form #1575

Open
RhetTbull opened this issue Jun 13, 2024 · 0 comments
Open

Add options for specifying unicode form #1575

RhetTbull opened this issue Jun 13, 2024 · 0 comments
Labels
feature request New feature or request

Comments

@RhetTbull
Copy link
Owner

RhetTbull commented Jun 13, 2024

@jotzet79 unicode is always tricky to deal with and it's entirely possible there's a bug in OSXPhotos. Here's what OSXPhotos does at the moment:

When comparing text, rendering templates, writing data to Photos (e.g. creating albums), etc., OSXPhotos always converts to NFC formatted unicode. This is consistent with what macOS does.

However, when creating filenames and directories, OSXPhotos will convert to NFD format if on macOS, otherwise NFC if on linux. This is consistent with how the default behavior of the two operating systems.

That means the album name in Photos may be different than the folder name on disk though visually they will be the same. Internally they would use 2 different unicode encodings.

I've considered in the past adding a unicode template that would convert text to a given encoding. For example:

{unicode.nfc:{folder_album}} or {folder_album|unicode.nfc}.

Internally this would take a fair bit of work because the template system normalizes everything. Another option is to specify the "internal" unicode format and the "external (on disk)" unicode format via options. This is much easier to implement as osxphotos already contains methods to globally adjust this in the code. For example:

osxphotos export --directory {folder_album} --unicode-filesystem NFC --unicode-internal NFD

I'll open a new issue for this.

Originally posted by @RhetTbull in #410 (comment)

@RhetTbull RhetTbull added the feature request New feature or request label Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant