Make locale work on Windows (patch from Herve Ruellan)