Cleanup and optimize StringUtils::ConvertUTF82UTF16

This commit is contained in:
Wojtek Figat
2021-03-07 18:09:26 +01:00
parent 862c02da6a
commit 2b42e9256c
2 changed files with 63 additions and 27 deletions

View File

@@ -184,14 +184,17 @@ public:
public:
// Convert characters from ANSI to UTF-16
// Converts characters from ANSI to UTF-16
static void ConvertANSI2UTF16(const char* from, Char* to, int32 len);
// Convert characters from UTF-16 to ANSI
// Converts characters from UTF-16 to ANSI
static void ConvertUTF162ANSI(const Char* from, char* to, int32 len);
// Convert characters from UTF-8 to UTF-16
static void ConvertUTF82UTF16(const char* from, Char* to, uint32 fromLength, uint32* toLength);
static void ConvertUTF82UTF16(const char* from, Char* to, int32 fromLength, int32& toLength);
// Convert characters from UTF-8 to UTF-16 (allocates the output buffer with Allocator::Allocate of size toLength + 1, call Allocator::Free after usage). Returns null on empty or invalid string.
static Char* ConvertUTF82UTF16(const char* from, int32 fromLength, int32& toLength);
public: