commit cd661fe56847a42023dbdb9ecb4d7315a3c757af
parent 8beb748646ec967ea5985a5d5ab640b673893d85
Author: Andrej Kacian <ticho@claws-mail.org>
Date: Fri, 14 Dec 2018 18:50:38 +0100
Make URI highlighting in textview and compose Unicode-aware.
Fixes bug #3519: Links including umlauts are broken
Diffstat:
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/common/utils.c b/src/common/utils.c
@@ -3404,9 +3404,10 @@ gboolean get_uri_part(const gchar *start, const gchar *scanpos,
*bp = scanpos;
/* find end point of URI */
- for (ep_ = scanpos; *ep_ != '\0'; ep_++) {
- if (!g_ascii_isgraph(*(const guchar *)ep_) ||
- !IS_ASCII(*(const guchar *)ep_) ||
+ for (ep_ = scanpos; *ep_ != '\0'; ep_ = g_utf8_next_char(ep_)) {
+ gunichar u = g_utf8_get_char_validated(ep_, -1);
+ if (!g_unichar_isgraph(u) ||
+ u == (gunichar)-1 ||
strchr("[]{}<>\"", *ep_)) {
break;
} else if (strchr("(", *ep_)) {