View Bug Details

IDProjectCategoryView StatusLast Update
0002218DCP-o-maticBugspublic2024-01-03 23:50
Reportercarl Assigned Tocarl  
PrioritynormalSeveritymajorReproducibilityunable to reproduce
Status acknowledgedResolutionopen 
Target Version2.16.x 
Summary0002218: Asset wxString::Format("%.3f", 1.23).find(str) != wxString::npos failed in GetInfoFromLCID(): Decimal separator mismatch
Description

Did you use setlocale? If so, use wxLocale to change the locale instead.

TagsNo tags attached.
Branchlibdcp:fmt
Estimated weeks required
Estimated work requiredUndecided

Activities

carl

2022-03-19 22:11

administrator   ~0004960

We do indeed do setlocale(LC_ALL, "");

carl

2022-03-19 23:13

administrator   ~0004961

Asked some questions about locale settings and what exactly triggered this; can't reproduce yet.

carl

2022-03-20 21:10

administrator   ~0004962

Sent 257a172 to reporter.

carl

2022-03-21 21:05

administrator   ~0004964

Last edited: 2022-03-21 21:05


int main()
{
    setlocale(LC_ALL, "");
    struct lconv* lc = localeconv();
    printf("thousands %s decimal %s\n", lc->thousands_sep, lc->decimal_point);
    return 0;
}

carl

2022-03-21 21:13

administrator   ~0004965

This gives the values from the custom settings fine. But - if you change the decimal separator to a "." in the spanish locale you then have the thousands separator also being a .

carl

2022-03-21 21:14

administrator   ~0004966

Last edited: 2022-03-23 21:47

Thenmake_raw in src/raw_convert.cc is totally broken. We could implement it ourselves, but it is very complicated to get it just right.

carl

2022-03-23 00:11

administrator   ~0004967

...or find some equivalent to std::to_chars from C++17

carl

2022-03-23 21:52

administrator   ~0004968

https://github.com/fmtlib/fmt isn't quite it, but maybe as close as we'll get.

carl

2022-03-24 10:19

administrator   ~0004972

... and fmt only goes from number to string, not back (though that is easier)

Bug History

Date Modified Username Field Change
2022-03-19 22:10 carl New Bug
2022-03-19 22:11 carl Note Added: 0004960
2022-03-19 23:12 carl Reproducibility have not tried => unable to reproduce
2022-03-19 23:12 carl Status new => feedback
2022-03-19 23:12 carl Estimated work required => Undecided
2022-03-19 23:13 carl Note Added: 0004961
2022-03-19 23:13 carl Status feedback => new
2022-03-19 23:13 carl Target Version 2.15.x => 2.16.x
2022-03-19 23:13 carl Assigned To => carl
2022-03-19 23:13 carl Status new => feedback
2022-03-20 21:10 carl Note Added: 0004962
2022-03-21 21:05 carl Note Added: 0004964
2022-03-21 21:05 carl Note Edited: 0004964
2022-03-21 21:13 carl Note Added: 0004965
2022-03-21 21:14 carl Note Added: 0004966
2022-03-21 21:15 carl Note Edited: 0004966
2022-03-23 00:11 carl Note Added: 0004967
2022-03-23 21:47 carl Note Edited: 0004966
2022-03-23 21:52 carl Note Added: 0004968
2022-03-24 10:19 carl Note Added: 0004972
2022-03-24 10:19 carl Branch => libdcp:fmt
2022-06-28 11:35 carl Priority urgent => normal
2024-01-03 23:50 carl Status feedback => acknowledged