diff options
author | Michal Schmidt <mschmidt@redhat.com> | 2012-11-02 17:27:15 +0100 |
---|---|---|
committer | Michal Schmidt <mschmidt@redhat.com> | 2012-11-02 17:27:15 +0100 |
commit | 0901758558506273c0b7553dc3cae587f2b94290 (patch) | |
tree | 654ff82aa499e9113e8de546d8972ffd25ab1bac /src/vconsole/vconsole-setup.c | |
parent | 4940c64240541e91411620b7dc0963e012aa6b91 (diff) |
util: add is_locale_utf8()
journalctl and vconsole-setup both implement utf8 locale detection.
Let's have a common function for it.
The next patch will add another use.
Diffstat (limited to 'src/vconsole/vconsole-setup.c')
-rw-r--r-- | src/vconsole/vconsole-setup.c | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/src/vconsole/vconsole-setup.c b/src/vconsole/vconsole-setup.c index 6e016ad338..cb7ade0d24 100644 --- a/src/vconsole/vconsole-setup.c +++ b/src/vconsole/vconsole-setup.c @@ -29,8 +29,6 @@ #include <stdbool.h> #include <stdarg.h> #include <limits.h> -#include <locale.h> -#include <langinfo.h> #include <sys/ioctl.h> #include <sys/wait.h> #include <linux/tiocl.h> @@ -48,19 +46,6 @@ static bool is_vconsole(int fd) { return ioctl(fd, TIOCLINUX, data) >= 0; } -static bool is_locale_utf8(void) { - const char *set; - - if (!setlocale(LC_ALL, "")) - return true; - - set = nl_langinfo(CODESET); - if (!set) - return true; - - return streq(set, "UTF-8"); -} - static int disable_utf8(int fd) { int r = 0, k; |