[gucharmap] charmap: Only add non-space printable character to codepoint link
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gucharmap] charmap: Only add non-space printable character to codepoint link
- Date: Sat, 28 Jan 2017 22:03:44 +0000 (UTC)
commit 5ced30444970b349a8c0e21f746f9e703c6f5e69
Author: Christian Persch <chpe gnome org>
Date: Sat Jan 28 23:02:24 2017 +0100
charmap: Only add non-space printable character to codepoint link
gucharmap/gucharmap-charmap.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/gucharmap/gucharmap-charmap.c b/gucharmap/gucharmap-charmap.c
index cf648a0..e7c8997 100644
--- a/gucharmap/gucharmap-charmap.c
+++ b/gucharmap/gucharmap-charmap.c
@@ -364,15 +364,20 @@ insert_codepoint (GucharmapCharmap *charmap,
GtkTextTag *tag;
char buf[7];
GUnicodeType t;
+ gboolean is_graph, is_Mn;
char nbsp[3] = "\302\240\0"; /* U+00A0 NO-BREAK SPACE */
t = g_unichar_type (uc);
+ is_Mn = t == G_UNICODE_NON_SPACING_MARK /* Mn */;
+ is_graph = g_unichar_isgraph (uc);
+
buf[g_unichar_to_utf8 (uc, buf)] = '\0';
- str = g_strdup_printf ("%s%s U+%4.4X %s",
+ str = g_strdup_printf ("%s%s%sU+%4.4X %s",
/* Per unicode standard, exhibit nonspacing marks on NBSP */
- t == G_UNICODE_NON_SPACING_MARK /* Mn */ ? nbsp : "",
- buf,
+ is_graph && is_Mn ? nbsp : "",
+ is_graph ? buf : "",
+ is_graph ? " " : "",
uc,
gucharmap_get_unicode_name (uc));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]