diff options
author | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2014-03-13 19:37:01 +0000 |
---|---|---|
committer | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2014-03-13 19:37:01 +0000 |
commit | c44bbcdc08b880bead0a196826d64031de36bee6 (patch) | |
tree | 072486c91acf7a2171c941c552e3d8afdbcbdb1a /amiga/gui_options.c | |
parent | 7a3d3437663ea6669811910f7671600d861a2f1f (diff) | |
download | netsurf-c44bbcdc08b880bead0a196826d64031de36bee6.tar.gz netsurf-c44bbcdc08b880bead0a196826d64031de36bee6.tar.bz2 |
Ensure any user-input URLs are passed to the core in UTF-8.
Everything else, including any content of the URL bar which hasn't just been entered by the user, is assumed to be in ASCII.
NB: The exception is the ARexx OPEN command. This is because NetSurf uses the ARexx port and this command internally when multiple instances are opened.
file: addresses typed into the address bar containing non-ASCII characters will probably no loger work, but it is expected that under normal circumstances, users will either drag'n'drop files or use Project=>Open. If it becomes an issue I will work around it at a later date.
Diffstat (limited to 'amiga/gui_options.c')
-rwxr-xr-x | amiga/gui_options.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/amiga/gui_options.c b/amiga/gui_options.c index b969eb8c8..400ced8a5 100755 --- a/amiga/gui_options.c +++ b/amiga/gui_options.c @@ -410,6 +410,8 @@ void ami_gui_opts_open(void) BOOL download_notify_disabled = FALSE; BOOL ptr_disable = FALSE; char animspeed[10]; + char *homepage_url_lc = ami_utf8_easy(nsoption_charp(homepage_url)); + struct TextAttr fontsans, fontserif, fontmono, fontcursive, fontfantasy; if(gow && gow->win) @@ -557,7 +559,7 @@ void ami_gui_opts_open(void) LAYOUT_AddChild, gow->objects[GID_OPTS_HOMEPAGE] = StringObject, GA_ID, GID_OPTS_HOMEPAGE, GA_RelVerify, TRUE, - STRINGA_TextVal, nsoption_charp(homepage_url), + STRINGA_TextVal, homepage_url_lc, STRINGA_BufferPos,0, StringEnd, CHILD_Label, LabelObject, @@ -1529,6 +1531,7 @@ void ami_gui_opts_open(void) gow->node = AddObject(window_list,AMINS_GUIOPTSWINDOW); gow->node->objstruct = gow; } + ami_utf8_free(homepage_url_lc); } void ami_gui_opts_use(bool save) @@ -1543,7 +1546,7 @@ void ami_gui_opts_use(bool save) ami_update_pointer(gow->win, GUI_POINTER_WAIT); GetAttr(STRINGA_TextVal,gow->objects[GID_OPTS_HOMEPAGE],(ULONG *)&data); - nsoption_set_charp(homepage_url, (char *)strdup((char *)data)); + nsoption_set_charp(homepage_url, (char *)ami_to_utf8_easy((char *)data)); GetAttr(STRINGA_TextVal,gow->objects[GID_OPTS_CONTENTLANG],(ULONG *)&data); nsoption_set_charp(accept_language, (char *)strdup((char *)data)); |