Enable RISC OS to display decoded IDNs in the URL bar (subject to local charset restrictions)

This commit is contained in:
Chris Young 2015-07-18 19:48:13 +01:00
parent 53141c7089
commit ac8eccd035

View File

@ -1038,8 +1038,16 @@ void gui_window_set_pointer(struct gui_window *g, gui_pointer_shape shape)
/* exported function documented in riscos/window.h */
nserror ro_gui_window_set_url(struct gui_window *g, nsurl *url)
{
char *idn_url = NULL;
if (g->toolbar) {
ro_toolbar_set_url(g->toolbar, nsurl_access(url), true, false);
if (nsoption_bool(display_decoded_idn) == false) {
ro_toolbar_set_url(g->toolbar, nsurl_access(url), true, false);
} else {
idn_url = nsurl_access_utf8(url);
ro_toolbar_set_url(g->toolbar, idn_url, true, false);
free(idn_url);
}
ro_gui_url_complete_start(g->toolbar);
}