summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-10-22 16:37:10 +0200
committerLennart Poettering <lennart@poettering.net>2018-11-16 15:52:22 +0100
commit52ecf1958d30e09551b3b7c618e4c9d652c27259 (patch)
tree709c59adff08172cd24e8227b84c4885db560fda /src
parent4e96eb682c187a08fb8560e89b27d46bc2b46223 (diff)
downloadsystemd-52ecf1958d30e09551b3b7c618e4c9d652c27259.tar.gz
systemd-52ecf1958d30e09551b3b7c618e4c9d652c27259.tar.bz2
systemd-52ecf1958d30e09551b3b7c618e4c9d652c27259.zip
locale-util: add special glyph support for check marks/cross marks
Diffstat (limited to 'src')
-rw-r--r--src/basic/locale-util.c4
-rw-r--r--src/basic/locale-util.h2
-rw-r--r--src/test/test-locale-util.c5
3 files changed, 10 insertions, 1 deletions
diff --git a/src/basic/locale-util.c b/src/basic/locale-util.c
index 9ad51a1972..7e479d605a 100644
--- a/src/basic/locale-util.c
+++ b/src/basic/locale-util.c
@@ -369,6 +369,8 @@ const char *special_glyph(SpecialGlyph code) {
[MDASH] = "-",
[ELLIPSIS] = "...",
[MU] = "u",
+ [CHECK_MARK] = "+",
+ [CROSS_MARK] = "-",
},
/* UTF-8 */
@@ -383,6 +385,8 @@ const char *special_glyph(SpecialGlyph code) {
[MDASH] = "\342\200\223", /* – */
[ELLIPSIS] = "\342\200\246", /* … */
[MU] = "\316\274", /* μ */
+ [CHECK_MARK] = "\342\234\223", /* ✓ */
+ [CROSS_MARK] = "\342\234\227", /* ✗ */
},
};
diff --git a/src/basic/locale-util.h b/src/basic/locale-util.h
index 14beece6d8..ea624e9908 100644
--- a/src/basic/locale-util.h
+++ b/src/basic/locale-util.h
@@ -49,6 +49,8 @@ typedef enum {
MDASH,
ELLIPSIS,
MU,
+ CHECK_MARK,
+ CROSS_MARK,
_SPECIAL_GLYPH_MAX
} SpecialGlyph;
diff --git a/src/test/test-locale-util.c b/src/test/test-locale-util.c
index 3634534782..6d0f24eeea 100644
--- a/src/test/test-locale-util.c
+++ b/src/test/test-locale-util.c
@@ -65,7 +65,7 @@ static void test_keymaps(void) {
#define dump_glyph(x) log_info(STRINGIFY(x) ": %s", special_glyph(x))
static void dump_special_glyphs(void) {
- assert_cc(MU + 1 == _SPECIAL_GLYPH_MAX);
+ assert_cc(CROSS_MARK + 1 == _SPECIAL_GLYPH_MAX);
log_info("/* %s */", __func__);
@@ -80,6 +80,9 @@ static void dump_special_glyphs(void) {
dump_glyph(ARROW);
dump_glyph(MDASH);
dump_glyph(ELLIPSIS);
+ dump_glyph(MU);
+ dump_glyph(CHECK_MARK);
+ dump_glyph(CROSS_MARK);
}
int main(int argc, char *argv[]) {