Revert "Fix Compile Warnings (#5963)"

This reverts commit b83e16dbdd.

Found regressions like auto orientation didn't work anymore after this change, revert it
This commit is contained in:
SoftFever
2024-08-12 00:00:20 +08:00
parent 0214bd5270
commit ab3d04312b
184 changed files with 1091 additions and 461 deletions

View File

@@ -1953,7 +1953,8 @@ std::string fold_utf8_to_ascii(const std::string &src, bool is_convert_for_filen
for (wchar_t c : wstr)
fold_to_ascii(c, out);
if (is_convert_for_filename) {
auto dstStr = boost::locale::conv::utf_to_utf<char>(dst);
std::wstring_convert<std::codecvt_utf8<wchar_t>> converter;
auto dstStr = converter.to_bytes(dst);
std::size_t found = dstStr.find_last_of("/\\");
if (found != std::string::npos) {
@@ -1963,7 +1964,7 @@ std::string fold_utf8_to_ascii(const std::string &src, bool is_convert_for_filen
std::string newFileName = regex_replace(filename, reg, "");
dstStr = dir + "\\" + newFileName;
}
return dstStr;
dst = converter.from_bytes(dstStr);
}
return boost::locale::conv::utf_to_utf<char>(dst.c_str(), dst.c_str() + dst.size());