mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-19 02:32:44 +03:00
Make nsurl utf8 string conversion function consistent with nsurl API.
This commit is contained in:
parent
dc0729150c
commit
1bb7d295bb
@ -4900,7 +4900,7 @@ static nserror gui_window_set_url(struct gui_window *g, nsurl *url)
|
|||||||
|
|
||||||
if(g == g->shared->gw) {
|
if(g == g->shared->gw) {
|
||||||
if(nsoption_bool(display_decoded_idn) == true) {
|
if(nsoption_bool(display_decoded_idn) == true) {
|
||||||
if (nsurl_access_utf8(url, &idn_url_s, &idn_url_l) == NSERROR_OK) {
|
if (nsurl_get_utf8(url, &idn_url_s, &idn_url_l) == NSERROR_OK) {
|
||||||
url_lc = ami_utf8_easy(idn_url_s);
|
url_lc = ami_utf8_easy(idn_url_s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2349,7 +2349,7 @@ nserror gui_window_set_url(struct gui_window *gw, nsurl *url)
|
|||||||
g = nsgtk_get_scaffold(gw);
|
g = nsgtk_get_scaffold(gw);
|
||||||
if (g->top_level == gw) {
|
if (g->top_level == gw) {
|
||||||
if (nsoption_bool(display_decoded_idn) == true) {
|
if (nsoption_bool(display_decoded_idn) == true) {
|
||||||
if (nsurl_access_utf8(url, &idn_url_s, &idn_url_l) != NSERROR_OK)
|
if (nsurl_get_utf8(url, &idn_url_s, &idn_url_l) != NSERROR_OK)
|
||||||
idn_url_s = NULL;
|
idn_url_s = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -817,7 +817,7 @@ void html_mouse_action(struct content *c, struct browser_window *bw,
|
|||||||
}
|
}
|
||||||
} else if (url) {
|
} else if (url) {
|
||||||
if (nsoption_bool(display_decoded_idn) == true) {
|
if (nsoption_bool(display_decoded_idn) == true) {
|
||||||
if (nsurl_access_utf8(url, &url_s, &url_l) != NSERROR_OK) {
|
if (nsurl_get_utf8(url, &url_s, &url_l) != NSERROR_OK) {
|
||||||
/* Unable to obtain a decoded IDN. This is not a fatal error.
|
/* Unable to obtain a decoded IDN. This is not a fatal error.
|
||||||
* Ensure the string pointer is NULL so we use the encoded version. */
|
* Ensure the string pointer is NULL so we use the encoded version. */
|
||||||
url_s = NULL;
|
url_s = NULL;
|
||||||
|
@ -1043,7 +1043,7 @@ nserror ro_gui_window_set_url(struct gui_window *g, nsurl *url)
|
|||||||
|
|
||||||
if (g->toolbar) {
|
if (g->toolbar) {
|
||||||
if (nsoption_bool(display_decoded_idn) == true) {
|
if (nsoption_bool(display_decoded_idn) == true) {
|
||||||
if (nsurl_access_utf8(url, &idn_url_s, &idn_url_l) != NSERROR_OK)
|
if (nsurl_get_utf8(url, &idn_url_s, &idn_url_l) != NSERROR_OK)
|
||||||
idn_url_s = NULL;
|
idn_url_s = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1700,7 +1700,7 @@ const char *nsurl_access(const nsurl *url)
|
|||||||
|
|
||||||
|
|
||||||
/* exported interface, documented in nsurl.h */
|
/* exported interface, documented in nsurl.h */
|
||||||
nserror nsurl_access_utf8(const nsurl *url, char **url_s, size_t *url_l)
|
nserror nsurl_get_utf8(const nsurl *url, char **url_s, size_t *url_l)
|
||||||
{
|
{
|
||||||
nserror err;
|
nserror err;
|
||||||
lwc_string *host;
|
lwc_string *host;
|
||||||
|
@ -181,7 +181,7 @@ const char *nsurl_access(const nsurl *url);
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Access a NetSurf URL object as a UTF-8 string (for human readable IDNs)
|
* Get a UTF-8 string (for human readable IDNs) from a NetSurf URL object
|
||||||
*
|
*
|
||||||
* \param url NetSurf URL object
|
* \param url NetSurf URL object
|
||||||
* \param url_s Returns a url string
|
* \param url_s Returns a url string
|
||||||
@ -195,7 +195,7 @@ const char *nsurl_access(const nsurl *url);
|
|||||||
*
|
*
|
||||||
* The length returned in url_l excludes the trailing '\0'.
|
* The length returned in url_l excludes the trailing '\0'.
|
||||||
*/
|
*/
|
||||||
nserror nsurl_access_utf8(const nsurl *url, char **url_s, size_t *url_l);
|
nserror nsurl_get_utf8(const nsurl *url, char **url_s, size_t *url_l);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user