mirror of
https://github.com/godotengine/godot.git
synced 2025-10-20 08:23:29 +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:
parent
28a3dee276
commit
0c5431644d
13 changed files with 321 additions and 198 deletions
|
@ -343,7 +343,7 @@ Error DirAccessUnix::change_dir(String p_dir) {
|
|||
String prev_dir;
|
||||
char real_current_dir_name[2048];
|
||||
ERR_FAIL_COND_V(getcwd(real_current_dir_name, 2048) == nullptr, ERR_BUG);
|
||||
if (prev_dir.parse_utf8(real_current_dir_name)) {
|
||||
if (prev_dir.parse_utf8(real_current_dir_name) != OK) {
|
||||
prev_dir = real_current_dir_name; //no utf8, maybe latin?
|
||||
}
|
||||
|
||||
|
@ -505,7 +505,7 @@ DirAccessUnix::DirAccessUnix() {
|
|||
// set current directory to an absolute path of the current directory
|
||||
char real_current_dir_name[2048];
|
||||
ERR_FAIL_COND(getcwd(real_current_dir_name, 2048) == nullptr);
|
||||
if (current_dir.parse_utf8(real_current_dir_name)) {
|
||||
if (current_dir.parse_utf8(real_current_dir_name) != OK) {
|
||||
current_dir = real_current_dir_name;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue