Add normalization of file names after creating .torrent file#37
Open
dramiik wants to merge 1 commit into
Open
Conversation
dramiik
marked this pull request as ready for review
November 8, 2025 20:53
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? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When my files contain non-ASCII characters (like diacritics, accents, symbols etc.), the .torrent file created by
mktorrentdoesn'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
mktorrentwithtorrentoolwhich is written in Python (https://pypi.org/project/torrentool/). Didn't solve the issue with normalization.