Replace String.lowercase_ascii with Uucp.Case.Fold for i18n-aware comparison - #3739
Open
JoeJoeflyn wants to merge 1 commit into
Open
Replace String.lowercase_ascii with Uucp.Case.Fold for i18n-aware comparison#3739JoeJoeflyn wants to merge 1 commit into
JoeJoeflyn wants to merge 1 commit into
Conversation
…parison Use Unicode case folding instead of ASCII-only lowercase for case-insensitive string comparison across the codebase. This fixes search/matching for non-ASCII names (e.g. José, Müller, École). case_fold is defined once in src/global/import.ml and reused everywhere via Ocamlorg.Import.String.case_fold. Resolves ocaml#2444
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.
Summary
String.lowercase_asciiwith Unicode case folding (Uucp.Case.Fold) for case-insensitive string comparisoncase_foldonce insrc/global/import.ml, reuse everywhere viaOcamlorg.Import.String.case_foldis_sub_ignore_caseto usecase_foldinstead oflowercase_asciiThis fixes case-insensitive matching for non-ASCII text (e.g. searching
écolenow matchesÉCOLE, whichString.lowercase_asciicould not handle since it only lowercases A-Z).uucpwas already a transitive dependency — this makes it a direct dependency ofocamlorg.global.Checklist
make fmtTest plan
make buildpassesmake testpasses (21 tests, all OK)case_fold "école" = case_fold "ÉCOLE"(was false withlowercase_ascii, now true)