diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-07-07 11:58:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-07 11:58:44 +0200 |
commit | bc419e1c5ee3a0cd8c4156b2e65d94f6f46c7543 (patch) | |
tree | 001582076bb72e265a8b6f469b2a19940432dcb4 /core/io | |
parent | 8ec6c075bd38620358c1cadafa1a515a5711695a (diff) | |
parent | 0c5431644d103728aa926896d9bbdf40ed8d5cc3 (diff) |
Merge pull request #62735 from bruvzg/unicode_parsers
Diffstat (limited to 'core/io')
-rw-r--r-- | core/io/file_access.cpp | 5 | ||||
-rw-r--r-- | core/io/marshalls.cpp | 2 |
2 files changed, 2 insertions, 5 deletions
diff --git a/core/io/file_access.cpp b/core/io/file_access.cpp index 7d8da1b11c..da25f23917 100644 --- a/core/io/file_access.cpp +++ b/core/io/file_access.cpp @@ -388,9 +388,7 @@ String FileAccess::get_as_utf8_string() const { w[len] = 0; String s; - if (s.parse_utf8((const char *)w)) { - return String(); - } + s.parse_utf8((const char *)w); return s; } @@ -516,7 +514,6 @@ String FileAccess::get_pascal_string() { String ret; ret.parse_utf8(cs.ptr()); - return ret; } diff --git a/core/io/marshalls.cpp b/core/io/marshalls.cpp index f71ea5c39e..8ee19f274e 100644 --- a/core/io/marshalls.cpp +++ b/core/io/marshalls.cpp @@ -78,7 +78,7 @@ static Error _decode_string(const uint8_t *&buf, int &len, int *r_len, String &r ERR_FAIL_COND_V(strlen < 0 || strlen + pad > len, ERR_FILE_EOF); String str; - ERR_FAIL_COND_V(str.parse_utf8((const char *)buf, strlen), ERR_INVALID_DATA); + ERR_FAIL_COND_V(str.parse_utf8((const char *)buf, strlen) != OK, ERR_INVALID_DATA); r_string = str; // Add padding |