fixed set_locale bug for unsupported locales