Use the set locale for boost::lexical_cast to fix #824.