diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b70c0fa1c..127060f70 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -73,7 +73,7 @@ jobs: python3 -m venv venv . venv/bin/activate pip3 install gcovr - gcovr --gcov-executable /usr/bin/gcov-14 -e ".+yara_rules.+" -r . build --xml coverage_report.xml --verbose + gcovr --gcov-executable /usr/bin/gcov-14 -e ".+yara_rules.+" -e ".+third_party.+" -e ".+external.+" -r . build --xml coverage_report.xml --verbose - name: Upload coverage reports to Codecov env: diff --git a/lib/external/libwolv b/lib/external/libwolv index eb826d70d..759035de2 160000 --- a/lib/external/libwolv +++ b/lib/external/libwolv @@ -1 +1 @@ -Subproject commit eb826d70d32fc5dd27541514cc56dc741d94416a +Subproject commit 759035de2d966c07f81638e2a1f80539a0f0daec diff --git a/lib/external/pattern_language b/lib/external/pattern_language index 1057425e1..c7cd05397 160000 --- a/lib/external/pattern_language +++ b/lib/external/pattern_language @@ -1 +1 @@ -Subproject commit 1057425e1b945ab61b45bcfe4a2018ef1b785f75 +Subproject commit c7cd053979fec6fffe4d924593e97efa65a8a4d5 diff --git a/main/gui/source/init/run/cli.cpp b/main/gui/source/init/run/cli.cpp index e227af9f2..5a1250604 100644 --- a/main/gui/source/init/run/cli.cpp +++ b/main/gui/source/init/run/cli.cpp @@ -8,6 +8,7 @@ #include #include +#include #if defined(OS_WINDOWS) @@ -47,7 +48,7 @@ namespace hex::init { // Skip the first argument (the executable path) and convert the rest to a vector of UTF-8 strings for (int i = 1; i < argc; i += 1) { std::wstring wcharArg = convertedCommandLine[i]; - std::string utf8Arg = std::wstring_convert>().to_bytes(wcharArg); + std::string utf8Arg = wolv::util::wstringToUtf8(wcharArg); args.push_back(utf8Arg); } diff --git a/plugins/builtin/source/content/data_inspector.cpp b/plugins/builtin/source/content/data_inspector.cpp index 922c3f40e..8bb8d88b1 100644 --- a/plugins/builtin/source/content/data_inspector.cpp +++ b/plugins/builtin/source/content/data_inspector.cpp @@ -351,16 +351,12 @@ namespace hex::plugin::builtin { auto c = hex::changeEndianness(wideChar, endian); - std::wstring_convert> converter("Invalid"); - - auto value = hex::format("{0}", c <= 255 ? makePrintable(c) : converter.to_bytes(c)); + auto value = hex::format("{0}", c <= 255 ? makePrintable(c) : wolv::util::wstringToUtf8(std::wstring(&c, 1))); return [value] { ImGuiExt::TextFormatted("'{0}'", value.c_str()); return value; }; }, [](const std::string &value, std::endian endian) -> std::vector { - std::wstring_convert> converter("Invalid"); - std::vector bytes; - auto wideString = converter.from_bytes(value.c_str()); + auto wideString = wolv::util::utf8ToWstring(value.c_str(), "Invalid"); std::copy(wideString.begin(), wideString.end(), std::back_inserter(bytes)); if (endian != std::endian::native) @@ -449,7 +445,7 @@ namespace hex::plugin::builtin { [](auto c) { return c == 0x00; }); buffer.erase(it, buffer.end()); - auto string = std::wstring_convert, char16_t>("Invalid").to_bytes(stringBuffer.data()); + auto string = wolv::util::utf16ToUtf8(stringBuffer, "Invalid"); value = copyValue = hex::encodeByteString({ string.begin(), string.end() }); if (value.size() > MaxStringLength) {