StrToFloat doesn't work anymore with trailing/ending spaces
Original Reporter info from Mantis: ChrisF
-
Reporter name:
Original Reporter info from Mantis: ChrisF
- Reporter name:
Description:
Due to a modification into the GetLocaleCharUTF8 function ("winlazutf8.inc" file in lazutils), the "non breakable space" character (i.e. $A0) returned from the GetLocaleInfoW Windows API call is now transformed into a "standard space" character (i.e. $20).
This causes the DefaultFormatSettings.ThousandSeparator value to be now set to this "standard space" character (when the locale Windows setting is using the "non breakable space" character, of course), instead of the correct Windows value.
Steps to reproduce:
var xx: extended;
...
xx := StrToFloat(' 2,75 '); // (Use a correct float value according to your own Windows local settings)
The StrToFloat call raises and EConvertError error.
Additional information:
It's possible that there are some other consequences due to the GetLocaleCharUTF8 modification; as now, all the Windows calls returning 2 as a length value for the response are processed and eventually modified (this was not the case before, i.e. Lazarus version 1.6.0 or older).
Mantis conversion info:
- Mantis ID: 31072
- Platform: win32
- Version: 1.6.2
- Fixed in revision: fpc r35203 (#7a324ede)