Use system-independent locale setting

This should make the locale setting work on Mac and Windows.