Improving locale handling to avoid problems in console logs on Windows