eliminate double calls to setlocale