Skip to content

Attachment filenames from macOS fail due to missing NFC normalization in Text app #7873

@dohlepascal

Description

@dohlepascal

Short summary of the issue

When attaching files from macOS in the Nextcloud Text app, filenames containing special characters are not properly linked. This happens because macOS uses NFD for filenames by default, but the Text app does not normalize them to NFC during upload. The issue occurs in Chrome and Firefox, while Safari works correctly because it automatically converts filenames to NFC on upload.

When attempting to attach files from macOS in the Nextcloud Text app, the files cannot be correctly linked. This is caused by a mismatch in Unicode normalization forms: macOS uses NFD for filenames by default, while the app expects NFC. Currently, the Text app does not normalize filenames during upload, which leads to issues when referencing these files.

  • Markdown syntax is not properly rendered in text
  • Markdown syntax is removed after closing text
  • Markdown syntax is changed after closing text
  • Something else: File attachments from macOS fail to link due to missing NFC normalization

Example markdown file

Uploaded form Windows Machine / converted with Normalizer
![Bro schüre.docx](.attachments.9168420/Bro%20sch%C3%BCre.docx)

Uploaded directly from Mac without Normalization
![Bro schüre (3).docx](.attachments.9168420/Bro%20schu%CC%88re%20%283%29.docx)

Screenshot of the rendering in text

Image

Details

  • Nextcloud version: 31.0.10 Community

Workaround / Suggested fix:

Inside the file /pathToNextcloud/apps/text/lib/Controller/AttachmentController.php, in the function uploadAttachment(string $token), change:

$newFileName = $file['name'];

to

$newFileName = normalizer_normalize($file['name'], Normalizer::FORM_C);

This normalizes the filename to NFC on upload, allowing proper linking of macOS files in all browsers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions