Fix multiple missing UTF-8 decoding.
This commit is contained in:
parent
1f0dc02649
commit
c69e0d16bc
13 changed files with 22 additions and 22 deletions
|
@ -189,7 +189,7 @@ bool ZipArchive::try_open_pack(const String &p_path, bool p_replace_files, uint6
|
||||||
f.package = pkg_num;
|
f.package = pkg_num;
|
||||||
unzGetFilePos(zfile, &f.file_pos);
|
unzGetFilePos(zfile, &f.file_pos);
|
||||||
|
|
||||||
String fname = String("res://") + filename_inzip;
|
String fname = String("res://") + String::utf8(filename_inzip);
|
||||||
files[fname] = f;
|
files[fname] = f;
|
||||||
|
|
||||||
uint8_t md5[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
|
uint8_t md5[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||||
|
|
|
@ -520,8 +520,8 @@ void ResourceCache::dump(const char *p_file, bool p_short) {
|
||||||
|
|
||||||
FileAccess *f = nullptr;
|
FileAccess *f = nullptr;
|
||||||
if (p_file) {
|
if (p_file) {
|
||||||
f = FileAccess::open(p_file, FileAccess::WRITE);
|
f = FileAccess::open(String::utf8(p_file), FileAccess::WRITE);
|
||||||
ERR_FAIL_COND_MSG(!f, "Cannot create file at path '" + String(p_file) + "'.");
|
ERR_FAIL_COND_MSG(!f, "Cannot create file at path '" + String::utf8(p_file) + "'.");
|
||||||
}
|
}
|
||||||
|
|
||||||
const String *K = nullptr;
|
const String *K = nullptr;
|
||||||
|
|
|
@ -346,7 +346,7 @@ String OS::get_model_name() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void OS::set_cmdline(const char *p_execpath, const List<String> &p_args) {
|
void OS::set_cmdline(const char *p_execpath, const List<String> &p_args) {
|
||||||
_execpath = p_execpath;
|
_execpath = String::utf8(p_execpath);
|
||||||
_cmdline = p_args;
|
_cmdline = p_args;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -70,7 +70,7 @@
|
||||||
<return type="String" />
|
<return type="String" />
|
||||||
<argument index="0" name="bytes" type="int" default="-1" />
|
<argument index="0" name="bytes" type="int" default="-1" />
|
||||||
<description>
|
<description>
|
||||||
Gets a string with byte-length [code]bytes[/code] from the stream. If [code]bytes[/code] is negative (default) the length will be read from the stream using the reverse process of [method put_string].
|
Gets an ASCII string with byte-length [code]bytes[/code] from the stream. If [code]bytes[/code] is negative (default) the length will be read from the stream using the reverse process of [method put_string].
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="get_u16">
|
<method name="get_u16">
|
||||||
|
|
|
@ -283,9 +283,9 @@ Array AudioDriverALSA::get_device_list() {
|
||||||
|
|
||||||
if (name != nullptr && !strncmp(name, "plughw", 6)) {
|
if (name != nullptr && !strncmp(name, "plughw", 6)) {
|
||||||
if (desc) {
|
if (desc) {
|
||||||
list.push_back(String(name) + ";" + String(desc));
|
list.push_back(String::utf8(name) + ";" + String::utf8(desc));
|
||||||
} else {
|
} else {
|
||||||
list.push_back(String(name));
|
list.push_back(String::utf8(name));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -540,7 +540,7 @@ Array AudioDriverCoreAudio::_get_device_list(bool capture) {
|
||||||
ERR_FAIL_NULL_V_MSG(buffer, list, "Out of memory.");
|
ERR_FAIL_NULL_V_MSG(buffer, list, "Out of memory.");
|
||||||
if (CFStringGetCString(cfname, buffer, maxSize, kCFStringEncodingUTF8)) {
|
if (CFStringGetCString(cfname, buffer, maxSize, kCFStringEncodingUTF8)) {
|
||||||
// Append the ID to the name in case we have devices with duplicate name
|
// Append the ID to the name in case we have devices with duplicate name
|
||||||
list.push_back(String(buffer) + " (" + itos(audioDevices[i]) + ")");
|
list.push_back(String::utf8(buffer) + " (" + itos(audioDevices[i]) + ")");
|
||||||
}
|
}
|
||||||
|
|
||||||
memfree(buffer);
|
memfree(buffer);
|
||||||
|
@ -597,7 +597,7 @@ void AudioDriverCoreAudio::_set_device(const String &device, bool capture) {
|
||||||
char *buffer = (char *)memalloc(maxSize);
|
char *buffer = (char *)memalloc(maxSize);
|
||||||
ERR_FAIL_NULL_MSG(buffer, "Out of memory.");
|
ERR_FAIL_NULL_MSG(buffer, "Out of memory.");
|
||||||
if (CFStringGetCString(cfname, buffer, maxSize, kCFStringEncodingUTF8)) {
|
if (CFStringGetCString(cfname, buffer, maxSize, kCFStringEncodingUTF8)) {
|
||||||
String name = String(buffer) + " (" + itos(audioDevices[i]) + ")";
|
String name = String::utf8(buffer) + " (" + itos(audioDevices[i]) + ")";
|
||||||
if (name == device) {
|
if (name == device) {
|
||||||
deviceId = audioDevices[i];
|
deviceId = audioDevices[i];
|
||||||
found = true;
|
found = true;
|
||||||
|
|
|
@ -231,7 +231,7 @@ void CameraFeedOSX::set_device(AVCaptureDevice *p_device) {
|
||||||
|
|
||||||
// get some info
|
// get some info
|
||||||
NSString *device_name = p_device.localizedName;
|
NSString *device_name = p_device.localizedName;
|
||||||
name = device_name.UTF8String;
|
name = String::utf8(device_name.UTF8String);
|
||||||
position = CameraFeed::FEED_UNSPECIFIED;
|
position = CameraFeed::FEED_UNSPECIFIED;
|
||||||
if ([p_device position] == AVCaptureDevicePositionBack) {
|
if ([p_device position] == AVCaptureDevicePositionBack) {
|
||||||
position = CameraFeed::FEED_BACK;
|
position = CameraFeed::FEED_BACK;
|
||||||
|
|
|
@ -362,16 +362,16 @@ void GDScriptTest::error_handler(void *p_this, const char *p_function, const cha
|
||||||
}
|
}
|
||||||
|
|
||||||
builder.append("\n>> on function: ");
|
builder.append("\n>> on function: ");
|
||||||
builder.append(p_function);
|
builder.append(String::utf8(p_function));
|
||||||
builder.append("()\n>> ");
|
builder.append("()\n>> ");
|
||||||
builder.append(String(p_file).trim_prefix(self->base_dir));
|
builder.append(String::utf8(p_file).trim_prefix(self->base_dir));
|
||||||
builder.append("\n>> ");
|
builder.append("\n>> ");
|
||||||
builder.append(itos(p_line));
|
builder.append(itos(p_line));
|
||||||
builder.append("\n>> ");
|
builder.append("\n>> ");
|
||||||
builder.append(p_error);
|
builder.append(String::utf8(p_error));
|
||||||
if (strlen(p_explanation) > 0) {
|
if (strlen(p_explanation) > 0) {
|
||||||
builder.append("\n>> ");
|
builder.append("\n>> ");
|
||||||
builder.append(p_explanation);
|
builder.append(String::utf8(p_explanation));
|
||||||
}
|
}
|
||||||
builder.append("\n");
|
builder.append("\n");
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,7 @@ String iOS::get_model() const {
|
||||||
NSString *platform = [NSString stringWithCString:model encoding:NSUTF8StringEncoding];
|
NSString *platform = [NSString stringWithCString:model encoding:NSUTF8StringEncoding];
|
||||||
free(model);
|
free(model);
|
||||||
const char *str = [platform UTF8String];
|
const char *str = [platform UTF8String];
|
||||||
return String(str != nullptr ? str : "");
|
return String::utf8(str != nullptr ? str : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
String iOS::get_rate_url(int p_app_id) const {
|
String iOS::get_rate_url(int p_app_id) const {
|
||||||
|
|
|
@ -159,7 +159,7 @@ void JoypadIPhone::start_processing() {
|
||||||
};
|
};
|
||||||
|
|
||||||
// tell Godot about our new controller
|
// tell Godot about our new controller
|
||||||
Input::get_singleton()->joy_connection_changed(joy_id, true, [controller.vendorName UTF8String]);
|
Input::get_singleton()->joy_connection_changed(joy_id, true, String::utf8([controller.vendorName UTF8String]));
|
||||||
|
|
||||||
// add it to our dictionary, this will retain our controllers
|
// add it to our dictionary, this will retain our controllers
|
||||||
[self.connectedJoypads setObject:controller forKey:[NSNumber numberWithInt:joy_id]];
|
[self.connectedJoypads setObject:controller forKey:[NSNumber numberWithInt:joy_id]];
|
||||||
|
|
|
@ -500,7 +500,7 @@ void DisplayServerJavaScript::vk_input_text_callback(const char *p_text, int p_c
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Call input_text
|
// Call input_text
|
||||||
Variant event = String(p_text);
|
Variant event = String::utf8(p_text);
|
||||||
Variant *eventp = &event;
|
Variant *eventp = &event;
|
||||||
Variant ret;
|
Variant ret;
|
||||||
Callable::CallError ce;
|
Callable::CallError ce;
|
||||||
|
@ -590,7 +590,7 @@ Vector<String> DisplayServerJavaScript::get_rendering_drivers_func() {
|
||||||
|
|
||||||
// Clipboard
|
// Clipboard
|
||||||
void DisplayServerJavaScript::update_clipboard_callback(const char *p_text) {
|
void DisplayServerJavaScript::update_clipboard_callback(const char *p_text) {
|
||||||
get_singleton()->clipboard = p_text;
|
get_singleton()->clipboard = String::utf8(p_text);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DisplayServerJavaScript::clipboard_set(const String &p_text) {
|
void DisplayServerJavaScript::clipboard_set(const String &p_text) {
|
||||||
|
|
|
@ -431,7 +431,7 @@ Error OS_LinuxBSD::move_to_trash(const String &p_path) {
|
||||||
if (trash_path.is_empty()) {
|
if (trash_path.is_empty()) {
|
||||||
char *dhome = getenv("XDG_DATA_HOME");
|
char *dhome = getenv("XDG_DATA_HOME");
|
||||||
if (dhome) {
|
if (dhome) {
|
||||||
trash_path = String(dhome) + "/Trash";
|
trash_path = String::utf8(dhome) + "/Trash";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -439,7 +439,7 @@ Error OS_LinuxBSD::move_to_trash(const String &p_path) {
|
||||||
if (trash_path.is_empty()) {
|
if (trash_path.is_empty()) {
|
||||||
char *home = getenv("HOME");
|
char *home = getenv("HOME");
|
||||||
if (home) {
|
if (home) {
|
||||||
trash_path = String(home) + "/.local/share/Trash";
|
trash_path = String::utf8(home) + "/.local/share/Trash";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -586,7 +586,7 @@ void OS_OSX::run() {
|
||||||
quit = true;
|
quit = true;
|
||||||
}
|
}
|
||||||
} @catch (NSException *exception) {
|
} @catch (NSException *exception) {
|
||||||
ERR_PRINT("NSException: " + String([exception reason].UTF8String));
|
ERR_PRINT("NSException: " + String::utf8([exception reason].UTF8String));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -602,7 +602,7 @@ Error OS_OSX::move_to_trash(const String &p_path) {
|
||||||
NSError *err;
|
NSError *err;
|
||||||
|
|
||||||
if (![fm trashItemAtURL:url resultingItemURL:nil error:&err]) {
|
if (![fm trashItemAtURL:url resultingItemURL:nil error:&err]) {
|
||||||
ERR_PRINT("trashItemAtURL error: " + String(err.localizedDescription.UTF8String));
|
ERR_PRINT("trashItemAtURL error: " + String::utf8(err.localizedDescription.UTF8String));
|
||||||
return FAILED;
|
return FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue