> Hi, > > How it should look (and hopefully work): > > char* oldLoc = setlocale(LC_NUMERIC, "C") std::stirng numberAsString = /* > printf/lexical_cast/iostream */; setlocale(LC_NUMERIC, oldLoc); > > Preferably - some RAII construct has to be implemented :) > > It's probably only portable solution. But: setlocale can be sloooow, so > maybe changing it once at begin of generation and restoring at end will > be needed (local changes are better, yet I don't know what are efficiency > expectations for code generator). > > -KG
Hmm - I'd really prefer not to have to change the locale for anything but the conversion. We have multiple threads running in parallel, and it's not possible to say if one of those is trying to get a localized version of a string at the same time as the locale is changed... Of course, the risk would probably not be huge, but it's still there... For reference, I've created an issue in the Jira system now - it can be found here: https://issues.apache.org/jira/browse/THRIFT-2870 Thanks, - Simon
