Skip to content

fix: normalize filenames to NFC to support MacOS (NFD) unicode characters#2620

Merged
monkeyiq merged 1 commit intofilesender:developmentfrom
ciari:development
Mar 16, 2026
Merged

fix: normalize filenames to NFC to support MacOS (NFD) unicode characters#2620
monkeyiq merged 1 commit intofilesender:developmentfrom
ciari:development

Conversation

@ciari
Copy link
Copy Markdown

@ciari ciari commented Mar 14, 2026

This PR addresses an issue where users on MacOS encounter an invalid_file_name error when uploading files containing unicode characters (e.g., Turkish characters like Ü, İ, Ş, or German umlauts).

MacOS uses NFD (Normalization Form Decomposed) by default for filenames. In NFD, a character like Ü is stored as two separate code points: U (U+0055) + ¨ (U+0308).

FileSender's filename validation logic in transfer.js uses XRegExp to test the filename. When it encounters these decomposed characters, the regex lastIndex check fails because it expects single-composed characters (NFC - Normalization Form Composed), leading to an incorrect "invalid filename" rejection even if the character itself is technically allowed in the configuration.

Before performing the regex validation in www/js/transfer.js, we now explicitly call file.name.normalize('NFC'). This ensures that any decomposed characters from MacOS are converted into their standard composed forms before the validation logic runs.

@monkeyiq monkeyiq merged commit 4cfd8e3 into filesender:development Mar 16, 2026
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.

2 participants