From 0c5431644d103728aa926896d9bbdf40ed8d5cc3 Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Tue, 5 Jul 2022 15:18:29 +0300 Subject: Allows parsing of invalid UTF-16 surrogates (can be encountered in Windows filenames) and some non-standard UTF-8 variants, makes Unicode parse errors more verbose. --- modules/gdscript/gdscript.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/gdscript/gdscript.cpp') diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp index e6aeef2fd1..bf83353ead 100644 --- a/modules/gdscript/gdscript.cpp +++ b/modules/gdscript/gdscript.cpp @@ -1050,7 +1050,7 @@ Error GDScript::load_source_code(const String &p_path) { w[len] = 0; String s; - if (s.parse_utf8((const char *)w)) { + if (s.parse_utf8((const char *)w) != OK) { ERR_FAIL_V_MSG(ERR_INVALID_DATA, "Script '" + p_path + "' contains invalid unicode (UTF-8), so it was not loaded. Please ensure that scripts are saved in valid UTF-8 unicode."); } -- cgit v1.2.3