summaryrefslogtreecommitdiff
path: root/src/journal
diff options
context:
space:
mode:
authorMichal Schmidt <mschmidt@redhat.com>2012-11-02 17:27:15 +0100
committerMichal Schmidt <mschmidt@redhat.com>2012-11-02 17:27:15 +0100
commit0901758558506273c0b7553dc3cae587f2b94290 (patch)
tree654ff82aa499e9113e8de546d8972ffd25ab1bac /src/journal
parent4940c64240541e91411620b7dc0963e012aa6b91 (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/journal')
-rw-r--r--src/journal/journalctl.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
index 0f20448bf..d1407abd9 100644
--- a/src/journal/journalctl.c
+++ b/src/journal/journalctl.c
@@ -33,8 +33,6 @@
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <linux/fs.h>
-#include <locale.h>
-#include <langinfo.h>
#include <systemd/sd-journal.h>
@@ -719,9 +717,7 @@ static int setup_keys(void) {
#ifdef HAVE_QRENCODE
/* If this is not an UTF-8 system don't print any QR codes */
- setlocale(LC_CTYPE, "");
-
- if (streq_ptr(nl_langinfo(CODESET), "UTF-8")) {
+ if (is_locale_utf8()) {
fputs("\nTo transfer the verification key to your phone please scan the QR code below:\n\n", stderr);
print_qr_code(stderr, seed, seed_size, n, arg_interval, hn, machine);
}