Repository navigation
Conversation
ToUpper()/ToLower() depend on the current culture: under tr-TR 'i' maps to a dotted capital I, so CharacterSetECI could not resolve names like iso-8859-1 and MAILTO: URLs were no longer recognized as e-mail addresses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Under a Turkish culture
"i".ToUpper()is the dotted"İ"and"I".ToLower()is the dotless"ı", so culture-sensitive case mapping broke two lookups:CharacterSetECI.getCharacterSetECIByName("iso-8859-1")andgetCharacterSetECI(Encoding)upper-cased the name (Encoding.WebNameis lower-case) to"İSO-8859-1"and returned null.EmailAddressResultParserlower-cased the text to check formailto:, soMAILTO:…was no longer recognized and the result type became TEXT.These three calls now use
ToUpperInvariant()/ToLowerInvariant().Tests (both set the current culture to tr-TR and restore it):
CharacterSetECITestCase.Should_Resolve_ECI_Independent_Of_Current_Culture: fails without the change (Expected: not null,But was: null).EmailAddressParsedResultTestCase.testMailtoPrefixIsCultureIndependent: fails without the change (Expected: EMAIL_ADDRESS,But was: TEXT).What I ran: this machine has no .NET Framework/NUnit 2 setup for the repo's test project, so I compiled the
zxing.portablesources with NUnit 4 in a scratch net8.0 project and ran the two new tests and the EmailAddress fixture there: 10 passed. In that setup other ECI tests fail on code pages that .NET 8 doesn't provide without a provider, which I didn't compare against the default branch. Please let CI run the real test project.QRCodeWriterand a fewWebName.ToUpper()calls (StringUtils,ECIEncoderSet,PDF417HighLevelEncoder) have the same pattern; I left them out to keep this change small and can follow up.Written with Claude Code (AI); I reviewed the change and ran the tests above.
🤖 Generated with Claude Code