On 12-5-2014 21:32, Jon A. Cruz wrote:
On Mon, May 12, 2014, at 12:03 PM, liamw wrote:
Hi Johan,
There was a thing in the building-inkspace file about
strtod.
// double dbl =
Glib::Ascii::strtod(srgb.substr(numPos + 3));
std::stringstream(
srgb.substr(numPos + 3) ) >> dbl;
That's basically all you have to do, except redeclare dbl
outside its scope.
That replacement is likely to cause problems. The standard
iostream operations are localizable, so being local sensitive
will make them produce different results or reject good data on
different systems. For example, the strtod conversion normally
runs into errors parsing things with a decimal separator as it
is ',' on a large portion of systems but is '.' on a large
portion of others.
Preventing such run-time errors is a key reason to use the
Glib::Ascii:* routines.