mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
main: configure locale *before* loading the config
Without this, config_load() can’t use wide-character functions properly.
This commit is contained in:
parent
49f4b3da64
commit
4d17c23224
1 changed files with 7 additions and 7 deletions
14
main.c
14
main.c
|
|
@ -352,6 +352,13 @@ main(int argc, char *const *argv)
|
|||
LOG_INFO("arch: %s/%zu-bit, ", name.machine, sizeof(void *) * 8);
|
||||
}
|
||||
|
||||
setlocale(LC_CTYPE, "");
|
||||
LOG_INFO("locale: %s", setlocale(LC_CTYPE, NULL));
|
||||
if (!locale_is_utf8()) {
|
||||
LOG_ERR("locale is not UTF-8");
|
||||
return ret;
|
||||
}
|
||||
|
||||
struct config conf = {NULL};
|
||||
if (!config_load(&conf, conf_path, &user_notifications, check_config)) {
|
||||
config_free(conf);
|
||||
|
|
@ -365,13 +372,6 @@ main(int argc, char *const *argv)
|
|||
|
||||
fcft_set_scaling_filter(conf.tweak.fcft_filter);
|
||||
|
||||
setlocale(LC_CTYPE, "");
|
||||
LOG_INFO("locale: %s", setlocale(LC_CTYPE, NULL));
|
||||
if (!locale_is_utf8()) {
|
||||
LOG_ERR("locale is not UTF-8");
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (conf_term != NULL) {
|
||||
free(conf.term);
|
||||
conf.term = xstrdup(conf_term);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue