genericptr / fpTOML

TOML parser for Free Pascal Compiler.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Float number and date parsing may fail in different countries

nussbaumer-planb opened this issue · comments

Problem: The float number and date parsing may fail in other countries, that is: where a system locale is set that is not English.
The reason for that is that you use the StrToFloat variant without the TFormatSettings parameter (two locations in TOMLParser.pas). This variant uses the system locale which may or may not match the TOML specification.

Solution: change these two code locations to use the StrToFloat variant that takes a second parameter of type TFormatSettings and specify settings that you created explicitly, e.g. by calling TFormatSettings.Create('en-US').