diff --git a/editor/editor_asset_installer.cpp b/editor/editor_asset_installer.cpp index 91853632f92..cab8ea7250b 100644 --- a/editor/editor_asset_installer.cpp +++ b/editor/editor_asset_installer.cpp @@ -124,7 +124,7 @@ void EditorAssetInstaller::open(const String &p_path, int p_depth) { char fname[16384]; unzGetCurrentFileInfo(pkg, &info, fname, 16384, nullptr, 0, nullptr, 0); - String name = fname; + String name = String::utf8(fname); files_sorted.insert(name); ret = unzGoToNextFile(pkg); @@ -304,7 +304,7 @@ void EditorAssetInstaller::ok_pressed() { char fname[16384]; ret = unzGetCurrentFileInfo(pkg, &info, fname, 16384, nullptr, 0, nullptr, 0); - String name = fname; + String name = String::utf8(fname); if (status_map.has(name) && status_map[name]->is_checked(0)) { String path = status_map[name]->get_metadata(0); diff --git a/editor/export_template_manager.cpp b/editor/export_template_manager.cpp index 42dc2b3fbdc..2c90639c8fe 100644 --- a/editor/export_template_manager.cpp +++ b/editor/export_template_manager.cpp @@ -399,7 +399,7 @@ bool ExportTemplateManager::_install_file_selected(const String &p_file, bool p_ char fname[16384]; ret = unzGetCurrentFileInfo(pkg, &info, fname, 16384, nullptr, 0, nullptr, 0); - String file = fname; + String file = String::utf8(fname); if (file.ends_with("version.txt")) { Vector data; data.resize(info.uncompressed_size); @@ -460,7 +460,7 @@ bool ExportTemplateManager::_install_file_selected(const String &p_file, bool p_ char fname[16384]; unzGetCurrentFileInfo(pkg, &info, fname, 16384, nullptr, 0, nullptr, 0); - String file_path(String(fname).simplify_path()); + String file_path(String::utf8(fname).simplify_path()); String file = file_path.get_file(); @@ -706,7 +706,7 @@ Error ExportTemplateManager::install_android_template_from_file(const String &p_ char fpath[16384]; ret = unzGetCurrentFileInfo(pkg, &info, fpath, 16384, nullptr, 0, nullptr, 0); - String path = fpath; + String path = String::utf8(fpath); String base_dir = path.get_base_dir(); if (!path.ends_with("/")) { diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index 763a9be538e..7287975fa40 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -203,7 +203,7 @@ private: char fname[16384]; ret = unzGetCurrentFileInfo(pkg, &info, fname, 16384, nullptr, 0, nullptr, 0); - if (String(fname).ends_with("project.godot")) { + if (String::utf8(fname).ends_with("project.godot")) { break; } @@ -513,7 +513,7 @@ private: char fname[16384]; unzGetCurrentFileInfo(pkg, &info, fname, 16384, nullptr, 0, nullptr, 0); - String name = fname; + String name = String::utf8(fname); if (name.ends_with("project.godot")) { zip_root = name.substr(0, name.rfind("project.godot")); break; @@ -533,7 +533,7 @@ private: char fname[16384]; ret = unzGetCurrentFileInfo(pkg, &info, fname, 16384, nullptr, 0, nullptr, 0); - String path = fname; + String path = String::utf8(fname); if (path == String() || path == zip_root || !zip_root.is_subsequence_of(path)) { // diff --git a/platform/android/export/export_plugin.cpp b/platform/android/export/export_plugin.cpp index 01c0c140a7f..d91977957be 100644 --- a/platform/android/export/export_plugin.cpp +++ b/platform/android/export/export_plugin.cpp @@ -3120,7 +3120,7 @@ Error EditorExportPlatformAndroid::export_project_helper(const Ref data; data.resize(info.uncompressed_size); @@ -3303,7 +3303,7 @@ Error EditorExportPlatformAndroid::export_project_helper(const Ref data; data.resize(info.compressed_size); diff --git a/platform/iphone/export/export.cpp b/platform/iphone/export/export.cpp index 04d149454de..3017a24bd0c 100644 --- a/platform/iphone/export/export.cpp +++ b/platform/iphone/export/export.cpp @@ -1755,7 +1755,7 @@ Error EditorExportPlatformIOS::export_project(const Ref &p_p char fname[16384]; ret = unzGetCurrentFileInfo(src_pkg_zip, &info, fname, 16384, nullptr, 0, nullptr, 0); - String file = fname; + String file = String::utf8(fname); print_line("READ: " + file); Vector data; diff --git a/platform/javascript/export/export.cpp b/platform/javascript/export/export.cpp index 8ec515e1c66..b45dd362156 100644 --- a/platform/javascript/export/export.cpp +++ b/platform/javascript/export/export.cpp @@ -375,7 +375,7 @@ Error EditorExportPlatformJavaScript::_extract_template(const String &p_template char fname[16384]; unzGetCurrentFileInfo(pkg, &info, fname, 16384, nullptr, 0, nullptr, 0); - String file = fname; + String file = String::utf8(fname); // Skip service worker and offline page if not exporting pwa. if (!pwa && (file == "godot.service.worker.js" || file == "godot.offline.html")) { diff --git a/platform/osx/export/export.cpp b/platform/osx/export/export.cpp index 7c3d3f24b81..2ee2ecd995d 100644 --- a/platform/osx/export/export.cpp +++ b/platform/osx/export/export.cpp @@ -657,7 +657,7 @@ Error EditorExportPlatformOSX::export_project(const Ref &p_p char fname[16384]; ret = unzGetCurrentFileInfo(src_pkg_zip, &info, fname, 16384, nullptr, 0, nullptr, 0); - String file = fname; + String file = String::utf8(fname); Vector data; data.resize(info.uncompressed_size); diff --git a/platform/uwp/export/export.cpp b/platform/uwp/export/export.cpp index 540a0235dc0..2177fdfae02 100644 --- a/platform/uwp/export/export.cpp +++ b/platform/uwp/export/export.cpp @@ -1265,10 +1265,10 @@ public: while (ret == UNZ_OK) { // get file name unz_file_info info; - char fname[16834]; - ret = unzGetCurrentFileInfo(pkg, &info, fname, 16834, nullptr, 0, nullptr, 0); + char fname[16384]; + ret = unzGetCurrentFileInfo(pkg, &info, fname, 16384, nullptr, 0, nullptr, 0); - String path = fname; + String path = String::utf8(fname); if (path.ends_with("/")) { // Ignore directories