Skip to content

fix: normalize NFD filenames to NFC before sending#43

Open
delphinus wants to merge 1 commit into
oflisback:mainfrom
delphinus:fix/nfc-normalization-macos
Open

fix: normalize NFD filenames to NFC before sending#43
delphinus wants to merge 1 commit into
oflisback:mainfrom
delphinus:fix/nfc-normalization-macos

Conversation

@delphinus

Copy link
Copy Markdown

macOS returns filenames in Unicode NFD (decomposed) form. When these NFD paths are sent to Obsidian's REST API, openLinkText fails to match against Obsidian's NFC-indexed paths, causing duplicate files to be created.

Add normalize_filename_for_mac() using vim.fn.iconv with macOS-specific "utf-8-mac" encoding to convert filenames to NFC before URL-encoding. On non-macOS platforms, the string is returned as-is.

macOS returns filenames in Unicode NFD (decomposed) form. When these
NFD paths are sent to Obsidian's REST API, openLinkText fails to match
against Obsidian's NFC-indexed paths, causing duplicate files to be
created.

Add normalize_filename_for_mac() using vim.fn.iconv with macOS-specific
"utf-8-mac" encoding to convert filenames to NFC before URL-encoding.
On non-macOS platforms, the string is returned as-is.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant