Skip to content

Add normalization of file names after creating .torrent file#37

Open
dramiik wants to merge 1 commit into
walkrflocka:masterfrom
dramiik:normalize-torrent-metadata
Open

Add normalization of file names after creating .torrent file#37
dramiik wants to merge 1 commit into
walkrflocka:masterfrom
dramiik:normalize-torrent-metadata

Conversation

@dramiik

@dramiik dramiik commented Nov 8, 2025

Copy link
Copy Markdown

When my files contain non-ASCII characters (like diacritics, accents, symbols etc.), the .torrent file created by mktorrent doesn't pass the verification in my Torrent client. This is because of the difference in normalization standard on MacOS (where I create .torrent file) and Linux (where I store files and run Torrent client). For more details see pobrn/mktorrent#14.

I've decided to post-process the .torrent file and add a function to normalize included files. Even though I tested this on my setup with multiple torrents, it would be great if someone else on MacOS could reproduce and confirm having the same issue.

Side note: I also tried to replace mktorrent with torrentool which is written in Python (https://pypi.org/project/torrentool/). Didn't solve the issue with normalization.

@dramiik
dramiik marked this pull request as ready for review November 8, 2025 20:53
@walkrflocka

Copy link
Copy Markdown
Owner

I like the direction you're going here, but it gives me pause that this isn't a narrower patch. I feel like we could handle this at creation time - admittedly I am not an expert on Unicode encoding, but there's got to be a better way than mutating an already created torrent file. Can you look into either setting up a narrower fix that checks for the presence of the NFD encoding rather than blanket assuming the torrent needs normalization?

@walkrflocka walkrflocka self-assigned this Dec 2, 2025
@walkrflocka walkrflocka added the bug Something isn't working label Dec 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants