summaryrefslogtreecommitdiff
path: root/modules/gdnative/godot/godot_string.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gdnative/godot/godot_string.cpp')
-rw-r--r--modules/gdnative/godot/godot_string.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/gdnative/godot/godot_string.cpp b/modules/gdnative/godot/godot_string.cpp
index 2a78b2c96f..757b8510cf 100644
--- a/modules/gdnative/godot/godot_string.cpp
+++ b/modules/gdnative/godot/godot_string.cpp
@@ -53,13 +53,13 @@ void GDAPI godot_string_new_data(godot_string *p_str, const char *p_contents, co
*p = String::utf8(p_contents, p_size);
}
-void GDAPI godot_string_get_data(const godot_string *p_str, wchar_t *p_dest, int *p_size) {
+void GDAPI godot_string_get_data(const godot_string *p_str, char *p_dest, int *p_size) {
String *p = (String *)p_str;
if (p_size != NULL) {
- *p_size = p->length();
+ *p_size = p->utf8().length();
}
if (p_dest != NULL) {
- memcpy(p_dest, p->ptr(), *p_size * sizeof(CharType));
+ memcpy(p_dest, p->utf8().get_data(), *p_size);
}
}
@@ -75,9 +75,9 @@ wchar_t GDAPI *godot_string_operator_index(godot_string *p_str, const godot_int
return &(s->operator[](p_idx));
}
-const wchar_t GDAPI *godot_string_c_str(const godot_string *p_str) {
+const char GDAPI *godot_string_c_str(const godot_string *p_str) {
const String *s = (const String *)p_str;
- return s->c_str();
+ return s->utf8().get_data();
}
godot_bool GDAPI godot_string_operator_equal(const godot_string *p_a, const godot_string *p_b) {