KNLMeansCL icon indicating copy to clipboard operation
KNLMeansCL copied to clipboard

Don't change the locale

Open myrsloik opened this issue 4 years ago • 1 comments

You can't change the locale if you're a library. It affects everything else that's also loaded and can actually cause locale related operations in other threads to crash. Apart from all the fun logic errors that can happen in applications that at least assume the decimal separator to be constant.

Just use snprintf_l (_snprintf_l on windows) and do it right. Or use C++ streams where the locale can be set locally as well.

myrsloik avatar Aug 05 '19 11:08 myrsloik

Yeah, I definitely wrote this library not really optimally. I had in mind to buy a Vega GPU and fix all the crap, but then the scarce availability and the crypto mining happened. Finally, with Navi GPU I should be able to do it.

Khanattila avatar Aug 05 '19 14:08 Khanattila