From dd38897a26cf888d2c546b7db9da8ec125a37b53 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Fri, 17 Jul 2015 20:59:49 +0100 Subject: Enable Amiga frontend to show decoded IDNs subject to local charset restrictions. TODO: Statusbar link text --- amiga/gui.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'amiga/gui.c') diff --git a/amiga/gui.c b/amiga/gui.c index b4f3b136d..8c2fde542 100644 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -4895,9 +4895,21 @@ static nserror gui_window_set_url(struct gui_window *g, nsurl *url) if(!g) return NSERROR_OK; if (g == g->shared->gw) { - RefreshSetGadgetAttrs((struct Gadget *)g->shared->objects[GID_URL], - g->shared->win, NULL, STRINGA_TextVal, - nsurl_access(url), TAG_DONE); + if(nsoption_bool(display_decoded_idn) == false) { + RefreshSetGadgetAttrs((struct Gadget *)g->shared->objects[GID_URL], + g->shared->win, NULL, + STRINGA_TextVal, nsurl_access(url), + TAG_DONE); + } else { + char *idn_url = nsurl_access_utf8(url); + char *idn_url_lc = ami_utf8_easy(idn_url); + RefreshSetGadgetAttrs((struct Gadget *)g->shared->objects[GID_URL], + g->shared->win, NULL, + STRINGA_TextVal, idn_url_lc, + TAG_DONE); + free(idn_url); + ami_utf8_free(idn_url_lc); + } } ami_update_buttons(g->shared); -- cgit v1.2.3