Skip to content

Fix .Numberize to be RFC 8259 compliant and not throw on Bulgarian systems.#1

Open
petersvp wants to merge 1 commit into
flashmandv:masterfrom
petersvp:master
Open

Fix .Numberize to be RFC 8259 compliant and not throw on Bulgarian systems.#1
petersvp wants to merge 1 commit into
flashmandv:masterfrom
petersvp:master

Conversation

@petersvp
Copy link
Copy Markdown

@petersvp petersvp commented Oct 11, 2024

C# has context of thread Globalization setting, the Thread Culture, and on some non-english systems, e.g. in Bulgarian, float.Parse excepts a comma instead of a dot while parsing. Which causes bugs and exceptions, especially a "NotImplementedException" when passing the string "1.234" while it expects "1,234".

I've fixed the library to explicitly pass InvariantCulture to these parse methods, respecting RFC 8259, forcing JSON-compliance and no "NotImplementedException" being thrown.

…read Culture, and on some non-english systems, e.g. in Bulgarian, float.Parse excepts a comma instead of a dot while parsing. Which causes bugs and exceptions, especially a "NotImplementedException" when passing the string "1.234" while it expects "1,234".

I've fixed the library to explicitly pass InvariantCulture to these parse methods, respecting RFC 8259
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