From d75d3591edf13ae0dd6aa989962595aa1280ae73 Mon Sep 17 00:00:00 2001 From: Relintai Date: Thu, 14 Nov 2024 01:06:33 +0100 Subject: [PATCH] Better solution for the previous fix. --- core/string/ustring.cpp | 4 ++++ core/string/ustring.h | 1 + platform/windows/os_windows.cpp | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/core/string/ustring.cpp b/core/string/ustring.cpp index 864229f24..fe9f2b1a2 100644 --- a/core/string/ustring.cpp +++ b/core/string/ustring.cpp @@ -5161,6 +5161,10 @@ String::String(const CharType *p_str) { copy_from(p_str); } +String::String(const Char16String &p_str) { + copy_from(p_str.ptr()); +} + String::String(const char *p_str, int p_clip_to_len) { copy_from(p_str, p_clip_to_len); } diff --git a/core/string/ustring.h b/core/string/ustring.h index 0d2f484c2..f4203f538 100644 --- a/core/string/ustring.h +++ b/core/string/ustring.h @@ -569,6 +569,7 @@ public: String(const char *p_str); String(const wchar_t *p_str); String(const CharType *p_str); + String(const Char16String &p_str); String(const char *p_str, int p_clip_to_len); String(const wchar_t *p_str, int p_clip_to_len); String(const CharType *p_str, int p_clip_to_len); diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index 289447413..5684c0280 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -2983,7 +2983,7 @@ Error OS_Windows::execute(const String &p_path, const List &p_arguments, CloseHandle(pipe[1]); } - ERR_FAIL_COND_V_MSG(ret == 0, ERR_CANT_FORK, "Could not create child process: " + String((wchar_t *) modstr.ptr())); + ERR_FAIL_COND_V_MSG(ret == 0, ERR_CANT_FORK, "Could not create child process: " + String(modstr)); if (p_blocking) { if (r_pipe) {