Menu

#19 Experimental Img32.Ctrls demo don't work on French Windows

1.0
closed
None
2022-03-18
2021-12-31
Pierre Y.
No

I got the CtrlDemo to start by adding this line as the very first instruction of the main program :

//------------------------------------------------------------------------------
// Application entry
//------------------------------------------------------------------------------

begin
  FormatSettings.DecimalSeparator := '.';

Default "French" (and maybe other) Windows environments have the "," set as the default decimal separator. The deserialization process by Img32.Storage.TStorage make use of TryStrToFloat(). Without a specific TFormatSettings, it relies on the Windows regional defaults and fails converting values to Delphi floats because of the decimal dot.

Maybe TStorage could embed it's own TFormatSettings and use it while loading XML ?

Regards,

-- Pierre Y.

Discussion

  • Angus Johnson

    Angus Johnson - 2021-12-31

    FormatSettings.DecimalSeparator := '.';

    Thanks. Yes, that definitely needs fixing.

     
  • Angus Johnson

    Angus Johnson - 2022-03-18
    • status: open --> closed