You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
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.
This commit is contained in:
@@ -62,7 +62,8 @@ String cwd() {
|
||||
}
|
||||
|
||||
String result;
|
||||
if (result.parse_utf16(buffer.ptr())) {
|
||||
result.parse_utf16(buffer.ptr());
|
||||
if (result.is_empty()) {
|
||||
return ".";
|
||||
}
|
||||
return result.simplify_path();
|
||||
@@ -73,7 +74,7 @@ String cwd() {
|
||||
}
|
||||
|
||||
String result;
|
||||
if (result.parse_utf8(buffer)) {
|
||||
if (result.parse_utf8(buffer) != OK) {
|
||||
return ".";
|
||||
}
|
||||
|
||||
@@ -114,7 +115,8 @@ String realpath(const String &p_path) {
|
||||
::CloseHandle(hFile);
|
||||
|
||||
String result;
|
||||
if (result.parse_utf16(buffer.ptr())) {
|
||||
result.parse_utf16(buffer.ptr());
|
||||
if (result.is_empty()) {
|
||||
return p_path;
|
||||
}
|
||||
|
||||
@@ -127,10 +129,10 @@ String realpath(const String &p_path) {
|
||||
}
|
||||
|
||||
String result;
|
||||
bool parse_ok = result.parse_utf8(resolved_path);
|
||||
Error parse_ok = result.parse_utf8(resolved_path);
|
||||
::free(resolved_path);
|
||||
|
||||
if (parse_ok) {
|
||||
if (parse_ok != OK) {
|
||||
return p_path;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user