-
Notifications
You must be signed in to change notification settings - Fork 51
Open
Description
I found a "bug" in the parsing of numbers. As of now the parsing is handled by the following line:
Line 159 in 150c42a
| auto number = std::stod(std::string{ sv.token() }); |
The problem is that
std::stod converts data using your locale hrence if your locale has the comma (,) as the decimal separator the parsing will not work correctly since the DBC standard uses the dot ..My locale is
it_IT.UTF-8 and unfortunately the decimal separator is the comma.When CANdb parses the following signal in the dbc file:
SG_ HVB_tCellMean : 23|16@0+ (0.01,-273.15) [-40|105] "degC" Charger,VCU
It will parse factor=0 instead of 0.04 and offset=-273 instead of -273.15
I changed my environment variable when using CANdb to en_US-UTF.8 and now it works.
I think the solution is to define the parsing locale in the libary itself or better: change the conversion function to not use locale at all.
Metadata
Metadata
Assignees
Labels
No labels