Bug #1153
Updated by Jörg Riesmeier 7 months ago
The output routines that convert DICOM datasets or structured reports to XML use the std::iostream functions to print certain floating point numbers (e.g. attribute values of OF and OD attributes, values of NUM content items in SR). These are not locale independent. Should an application change the process-global locale with @std::locale::global()@, then in certain locales such as German a comma instead of a point will be printed as decimal separator. Furthermore, iostream prints NaN values with sign bit as "-nan", which is not expected or supported by the conversion routines that convert XML back to DICOM. In these places, -OFStandard::atof()- OFStandard::ftoa() OFStandard::atof() should be used, which is locale independent and prints NaN values without sign. Also affected are routines that print certain lookup tables into a text file. In detail, the following methods need to be fixed: * @DSRNumericMeasurementValue::writeXML()@ * @DcmOtherFloat::writeXML()@ * @DcmOtherDouble::writeXML()@ * @DiCIELABLUT::createLUT()@ * @DiGSDFLUT::createLUT()@ Reported 2025-02-17 by Mathieu Malaterre <mathieu.malaterre@gmail.com>.