mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-28 07:47:03 -05:00
build: Updated libwolv
This commit is contained in:
2
lib/external/libwolv
vendored
2
lib/external/libwolv
vendored
Submodule lib/external/libwolv updated: 75c6693441...a745623029
2
lib/external/pattern_language
vendored
2
lib/external/pattern_language
vendored
Submodule lib/external/pattern_language updated: bc002793b0...950a475475
@@ -40,16 +40,20 @@ namespace hex::init {
|
||||
// On Windows, argv contains UTF-16 encoded strings, so we need to convert them to UTF-8
|
||||
auto convertedCommandLine = ::CommandLineToArgvW(::GetCommandLineW(), &argc);
|
||||
if (convertedCommandLine == nullptr) {
|
||||
log::error("Failed to convert command line arguments to UTF-8");
|
||||
log::error("Failed to get command line arguments");
|
||||
std::exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
// 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 = wolv::util::wstringToUtf8(wcharArg);
|
||||
auto utf8Arg = wolv::util::wstringToUtf8(wcharArg);
|
||||
if (!utf8Arg.has_value()) {
|
||||
log::error("Failed to convert command line arguments to UTF-8");
|
||||
std::exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
args.push_back(utf8Arg);
|
||||
args.push_back(*utf8Arg);
|
||||
}
|
||||
|
||||
::LocalFree(convertedCommandLine);
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace hex::plugin::builtin {
|
||||
ImGui::EndTabBar();
|
||||
}
|
||||
|
||||
if(ImGuiExt::IconHyperlink(ICON_VS_SEARCH, "hex.builtin.view.hex_editor.search.advanced"_lang)) {
|
||||
if (ImGuiExt::IconHyperlink(ICON_VS_SEARCH, "hex.builtin.view.hex_editor.search.advanced"_lang)) {
|
||||
TaskManager::doLater([editor] {
|
||||
const auto& view = ContentRegistry::Views::getViewByName("hex.builtin.view.find.name");
|
||||
|
||||
@@ -286,25 +286,29 @@ namespace hex::plugin::builtin {
|
||||
}
|
||||
case Encoding::UTF16: {
|
||||
auto utf16 = wolv::util::utf8ToUtf16(s_inputString);
|
||||
if (!utf16.has_value())
|
||||
return;
|
||||
|
||||
for (auto &c: utf16) {
|
||||
for (auto &c : *utf16) {
|
||||
swapEndianness(c, Encoding::UTF16, m_stringEndianness);
|
||||
}
|
||||
|
||||
std::copy(reinterpret_cast<const u8 *>(utf16.data()),
|
||||
reinterpret_cast<const u8 *>(utf16.data() + utf16.size()),
|
||||
std::copy(reinterpret_cast<const u8 *>(utf16->data()),
|
||||
reinterpret_cast<const u8 *>(utf16->data() + utf16->size()),
|
||||
std::back_inserter(m_searchByteSequence));
|
||||
break;
|
||||
}
|
||||
case Encoding::UTF32: {
|
||||
auto utf32 = wolv::util::utf8ToUtf32(s_inputString);
|
||||
if (!utf32.has_value())
|
||||
return;
|
||||
|
||||
for (auto &c: utf32) {
|
||||
for (auto &c : *utf32) {
|
||||
swapEndianness(c, Encoding::UTF32, m_stringEndianness);
|
||||
}
|
||||
|
||||
std::copy(reinterpret_cast<const u8 *>(utf32.data()),
|
||||
reinterpret_cast<const u8 *>(utf32.data() + utf32.size()),
|
||||
std::copy(reinterpret_cast<const u8 *>(utf32->data()),
|
||||
reinterpret_cast<const u8 *>(utf32->data() + utf32->size()),
|
||||
std::back_inserter(m_searchByteSequence));
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user