NFD-NFC Normalization Issues with Wiki Links in Obsidian

Steps to reproduce

  1. Start with a Sandbox Vault.
  2. Create one or more files with a native Mac app editor (e.g., Sublime or TextEdit) using filenames that contain diacritics (like ä, ü, ö, à, è, ò). Do not use the terminal for this.
  3. Save the files in the Sandbox Vault folder using Finder, e.g., in a new folder called “test.”
  4. Create the Python script generate_wiki_links:
#!/usr/bin/env python3
import os
import sys

def generate_wiki_links(folder_path):
    """
    Generate a Markdown file with wiki links for all Markdown files in the specified folder.

    Args:
        folder_path (str): Path to the folder containing Markdown files.

    Returns:
        None
    """
    # Check if the provided path is a directory
    if not os.path.isdir(folder_path):
        print(f"Error: The path '{folder_path}' is not a valid directory.")
        return

    # Prepare the output Markdown file
    output_file_path = os.path.join(folder_path, "wiki_links.md")
    
    with open(output_file_path, "w", encoding="utf-8") as output_file:
        output_file.write("# Wiki Links\n\n")
        
        # Iterate through all files in the directory
        for filename in os.listdir(folder_path):
            if filename.endswith(".md"):  # Only process Markdown files
                # Use the original filename directly
                note_name = os.path.splitext(filename)[0]  # Remove the .md extension
                # Write the wiki link to the output file
                output_file.write(f"- [[{note_name}]]\n")

    print(f"Wiki links saved to: {output_file_path}")

if __name__ == "__main__":
    if len(sys.argv) != 2:
        print("Usage: python generate_wiki_links.py <folder_path>")
        sys.exit(1)

    folder_path = sys.argv[1]
    generate_wiki_links(folder_path)
  1. Run the script in the terminal: python3 generate_wiki_links.py ~/Library/Application\ Support/obsidian/Obsidian\ Test/
  2. Open the wiki_links.md file in Obsidian.
  3. Click one of the links.
  4. A new note will be created; clicking again will create another new note.

Did you follow the troubleshooting guide? [Y/N]

Y

Expected result

Open the exisiting note

Actual result

Creates a new note. However, this note isn’t connected to the wiki link either, because clicking again creates another new note.

Environment

SYSTEM INFO:
Obsidian version: v1.8.3
Installer version: v1.7.4
Operating system: Darwin Kernel Version 24.3.0: Thu Jan 2 20:24:16 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T6000 24.3.0
Login status: logged in
Language: de
Catalyst license: supporter
Insider build toggle: on
Live preview: on
Base theme: adapt to system
Community theme: none
Snippets enabled: 0
Restricted mode: off
Plugins installed: 0
Plugins enabled: 0

Additional information

If you create a link to the document manually inside Obsidian, it will be encoded as NFC-normalized UTF-8 and will work correctly. This may be an edge case when creating links outside of Obsidian, but it should still function properly.

In the meantime, I learned that I could handle this at the script level for my Python script, but I’m unsure if this might cause issues elsewhere.

Related issue: Incorrect handling not NFC-normalized file names

Steps to reproduce

Consider two visually identical characters

  1. й (NFC-normalized, U+0439). For simplicity, we will call this symbol as X
  2. й (not NFC-normalized, two Unicode characters, U+0438, U+0306). For simplicity, we will call this symbol as Y.

  1. Create Y.md in vault folder. Do this outside Obsidian.
  2. Internally Obsidian will rename to it to X.md, while in file system it is still Y.md.
  3. app.vault.getFileByPath('X.md') returns the file (F)
  4. app.vault.getFileByPath('Y.md') returns null
  5. app.vault.adapter.getFullRealPath(F.path) returns path\to\vault\X.md while in file system it is path\to\vault\Y.md

Even more, you can even have both X.md and Y.md in the same vault folder and Obsidian will consider them as one file with unpredictable behavior.

Did you follow the troubleshooting guide? [Y/N]

Y

Expected result

Obsidian shows warning with suggestion to rename not NFC-normalized file names as they are discovered in the vault.

Actual result

Obsidian silently treats not NFC-normalized file names as NFC-normalized.

Environment

SYSTEM INFO:
	Obsidian version: v1.9.2
	Installer version: v1.7.7
	Operating system: Windows 11 Pro 10.0.26100
	Login status: logged in
	Language: en
	Catalyst license: vip
	Insider build toggle: on
	Live preview: on
	Base theme: adapt to system
	Community theme: none
	Snippets enabled: 0
	Restricted mode: off
	Plugins installed: 0
	Plugins enabled: 0

RECOMMENDATIONS:
	none