error, and if ERROR is not NULL, also set *ERROR to the appropriate
error code. */
struct url *
-url_parse (const char *url, int *error, bool *utf8_encode)
+url_parse (const char *url, int *error)
{
struct url *u;
const char *p;
goto error;
}
- if (opt.enable_iri && *utf8_encode)
+ if (opt.enable_iri && get_utf8_encode () && !get_ugly_no_encode ())
{
const char *new;
+ bool utf8_encode;
url_unescape ((char *) url);
- *utf8_encode = remote_to_utf8 (url, &new);
- if (*utf8_encode)
+ utf8_encode = remote_to_utf8 (url, &new);
+ set_utf8_encode (utf8_encode);
+ if (utf8_encode)
url = new;
}
if (opt.enable_iri)
{
- char *new = idn_encode (u->host, *utf8_encode);
+ char *new = idn_encode (u->host, get_utf8_encode ());
if (new)
{
xfree (u->host);