Skip to content

Fix special characters in map seeds breaking file/folder creation#55

Merged
JonathanTroyer merged 2 commits intomasterfrom
claude/fix-special-chars-maps-01QZHBzGSpg6fLgV13cya6sc
Dec 7, 2025
Merged

Fix special characters in map seeds breaking file/folder creation#55
JonathanTroyer merged 2 commits intomasterfrom
claude/fix-special-chars-maps-01QZHBzGSpg6fLgV13cya6sc

Conversation

@JonathanTroyer
Copy link
Owner

Use Path.GetInvalidFileNameChars() instead of Path.GetInvalidPathChars() when escaping the seed string for subdirectory names. GetInvalidPathChars only returns control characters, missing characters like : < > " * ? | which are invalid in file/folder names on Windows.

This fixes maps with seeds like "MountainPeople:3<3!!!!. failing to create output directories. Special thanks to @JazzyRomance on the Progress Renderer Discord for finding this.

Use Path.GetInvalidFileNameChars() instead of Path.GetInvalidPathChars()
when escaping the seed string for subdirectory names. GetInvalidPathChars
only returns control characters, missing characters like : < > " * ? |
which are invalid in file/folder names on Windows.

This fixes maps with seeds like "MountainPeople:3<3!!!!. failing to
create output directories.
Apply Path.GetInvalidFileNameChars() escaping directly in
CreateImageNameDateTime() and CreateImageNameNumbered() for the seed
string and map name. This ensures special characters are stripped
at the source, making the escaping explicit and consistent with the
subdirectory escaping.
@JonathanTroyer JonathanTroyer merged commit 713be34 into master Dec 7, 2025
1 check failed
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