Skip to content

fix(FlatPathTable): hash paths culture-invariantly - #28

Open
skippdot wants to merge 1 commit into
OpenOrbis:masterfrom
skippdot:pr/fpt-hash-invariant-culture
Open

skippdot wants to merge 1 commit into
OpenOrbis:masterfrom
skippdot:pr/fpt-hash-invariant-culture

Conversation

@skippdot

@skippdot skippdot commented Oct 6, 2026

Copy link
Copy Markdown

FlatPathTable.HashFunction upper-cases with char.ToUpper, which uses the current culture. On a Turkish-locale machine 'i' becomes 'İ' (U+0130), so the flat path table (and collision detection) differs from what the console computes for the same path.

Fix: char.ToUpperInvariant. Hashes for ASCII paths are unchanged on every other culture. I checked the algorithm against the flat path tables of two retail-built packages: every path hash matches. They had no non-ASCII names, so the retail behaviour for non-ASCII names is still unverified.

Test: FlatPathTableHashTests.FlatPathTableHash_IsCultureInvariant (file.bin / FILE.BIN must collide under tr-TR). Fails on master.

char.ToUpper uses the current culture; on a Turkish-locale machine 'i' upper-cases to U+0130, so the flat path table and collision detection differ from the console's. Behaviour for non-ASCII names on retail is unverified.
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.

1 participant