Add methods to decode/encode multibyte encodings.
This commit is contained in:
committed by
Pāvels Nadtočajevs
parent
b13c96b097
commit
48bfe13e4f
@@ -34,6 +34,8 @@
|
||||
#include "core/math/color.h"
|
||||
#include "core/math/math_funcs.h"
|
||||
#include "core/object/object.h"
|
||||
#include "core/os/memory.h"
|
||||
#include "core/os/os.h"
|
||||
#include "core/string/print_string.h"
|
||||
#include "core/string/string_name.h"
|
||||
#include "core/string/translation_server.h"
|
||||
@@ -5987,6 +5989,10 @@ Vector<uint8_t> String::to_wchar_buffer() const {
|
||||
#endif
|
||||
}
|
||||
|
||||
Vector<uint8_t> String::to_multibyte_char_buffer(const String &p_encoding) const {
|
||||
return OS::get_singleton()->string_to_multibyte(p_encoding, *this);
|
||||
}
|
||||
|
||||
#ifdef TOOLS_ENABLED
|
||||
/**
|
||||
* "Tools TRanslate". Performs string replacement for internationalization
|
||||
|
||||
@@ -618,6 +618,7 @@ public:
|
||||
Vector<uint8_t> to_utf16_buffer() const;
|
||||
Vector<uint8_t> to_utf32_buffer() const;
|
||||
Vector<uint8_t> to_wchar_buffer() const;
|
||||
Vector<uint8_t> to_multibyte_char_buffer(const String &p_encoding = String()) const;
|
||||
|
||||
// Constructors for NULL terminated C strings.
|
||||
String(const char *p_cstr) {
|
||||
|
||||
Reference in New Issue
Block a user