Skip to content

Format refresh and freq with the invariant culture - #101

Merged
mnadareski merged 1 commit into
SabreTools:mainfrom
gmipf:fix/invariant-refresh
Oct 16, 2026
Merged

mnadareski merged 1 commit into
SabreTools:mainfrom
gmipf:fix/invariant-refresh

Conversation

@gmipf

@gmipf gmipf commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Follow-up to SabreTools/SabreTools.IO#5. The DAT writers format Refresh and Freq with ToString("0.000000") in the current culture, so a German or French system writes refresh="123,450000". Since IO#5, ConvertToDouble parses that with the invariant culture and gets 123450000. FilterObject also formats Refresh with the current culture before it parses it, so a refresh/freq filter does not match on such a system.

This formats both with the invariant culture. The new tests set en-US, de-DE and fr-FR themselves and fail without the change on any system culture.

Measured on a de-DE system (net10.0):

  • IO main (19d73bd, with IO#5): without the change 10 round-trip tests (ClrMamePro, Listxml, M1, Mess) and 4 filter tests fail; with it all pass.
  • IO 2.3.0: the 4 filter tests fail without the change; with it the 10 round-trip tests fail instead, because 2.3.0 still parses with the current culture. So this belongs with the update to the next IO release.

I also ran the whole suite once per formatting group of the 606 specific cultures .NET knows (190 groups). With this change and IO main all pass, except TypeLengthValueTests.Format_ValidUTCTime in 9 groups that use . as the time separator (fails the same without this change).

Prepared with AI assistance (Claude Opus 5.5) and reviewed before submission.

The DAT writers and the filter formatted Refresh and Freq with the
current culture, so a German or French system wrote "123,450000".
SabreTools.IO parses these values with the invariant culture.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mnadareski
mnadareski merged commit 6238fcb into SabreTools:main Oct 16, 2026
1 check passed
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