diff --git a/src/lib/uri.cpp b/src/lib/uri.cpp index 7780732..9cd24ef 100644 --- a/src/lib/uri.cpp +++ b/src/lib/uri.cpp @@ -688,6 +688,11 @@ string URI::to_utf8(const string &str) detect_encoding(); } + if (_encoding == "utf-8") + { + return str; + } + return boost::locale::conv::to_utf(str, _encoding); } @@ -698,7 +703,7 @@ void URI::detect_encoding() re_encoding.split(_document, matches); if (matches.size() >= 2) { - _encoding = matches[1]; + _encoding = boost::locale::to_lower(matches[1]); } }