Do not attempt to convert encoding if it is already utf-8.
This commit is contained in:
parent
d4d7cd4efd
commit
56dc4083ce
|
@ -688,6 +688,11 @@ string URI::to_utf8(const string &str)
|
||||||
detect_encoding();
|
detect_encoding();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_encoding == "utf-8")
|
||||||
|
{
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
return boost::locale::conv::to_utf<char>(str, _encoding);
|
return boost::locale::conv::to_utf<char>(str, _encoding);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -698,7 +703,7 @@ void URI::detect_encoding()
|
||||||
re_encoding.split(_document, matches);
|
re_encoding.split(_document, matches);
|
||||||
if (matches.size() >= 2)
|
if (matches.size() >= 2)
|
||||||
{
|
{
|
||||||
_encoding = matches[1];
|
_encoding = boost::locale::to_lower(matches[1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue