Set locale and encoding