@azonenberg Library code can never safely call setlocale. It's thread unsafe and specifically dangerous if there are any other threads doing anything that might relate to locale (formally, unsafe if any other threads might call any stdlib functions). And even single threaded it clobbers state belonging to library's caller.