summaryrefslogtreecommitdiffstats
path: root/core/string
diff options
context:
space:
mode:
authorbruvzg <7645683+bruvzg@users.noreply.github.com>2023-02-13 16:18:12 +0200
committerbruvzg <7645683+bruvzg@users.noreply.github.com>2023-03-21 15:39:54 +0200
commitd72b5632505a308e7f7a8a534d308884e80936db (patch)
tree58d4b1117b9a31f9133748becf41b0c06b1693ed /core/string
parent2a05522283fbd8ce9c887b17548debf4bcd3e8a4 (diff)
downloadredot-engine-d72b5632505a308e7f7a8a534d308884e80936db.tar.gz
Add GDScript `to_wchar_buffer` and `get_string_from_wchar` functions.
Diffstat (limited to 'core/string')
-rw-r--r--core/string/ustring.cpp8
-rw-r--r--core/string/ustring.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/core/string/ustring.cpp b/core/string/ustring.cpp
index 1b3b070592..6a59942a56 100644
--- a/core/string/ustring.cpp
+++ b/core/string/ustring.cpp
@@ -5034,6 +5034,14 @@ Vector<uint8_t> String::to_utf32_buffer() const {
return retval;
}
+Vector<uint8_t> String::to_wchar_buffer() const {
+#ifdef WINDOWS_ENABLED
+ return to_utf16_buffer();
+#else
+ return to_utf32_buffer();
+#endif
+}
+
#ifdef TOOLS_ENABLED
/**
* "Tools TRanslate". Performs string replacement for internationalization
diff --git a/core/string/ustring.h b/core/string/ustring.h
index 1582504c57..28e3af92c5 100644
--- a/core/string/ustring.h
+++ b/core/string/ustring.h
@@ -455,6 +455,7 @@ public:
Vector<uint8_t> to_utf8_buffer() const;
Vector<uint8_t> to_utf16_buffer() const;
Vector<uint8_t> to_utf32_buffer() const;
+ Vector<uint8_t> to_wchar_buffer() const;
String(const char *p_str);
String(const wchar_t *p_str);