Merge pull request #3877 from Kelimion/wstring_fix

Fix utf8_to_wstring given zero bytes.
This commit is contained in:
Jeroen van Rijn
2024-07-05 13:58:49 +02:00
committed by GitHub
+2 -2
View File
@@ -53,8 +53,8 @@ utf8_to_utf16 :: proc(s: string, allocator := context.temp_allocator) -> []u16 {
return text[:n] return text[:n]
} }
utf8_to_wstring :: proc(s: string, allocator := context.temp_allocator) -> wstring { utf8_to_wstring :: proc(s: string, allocator := context.temp_allocator) -> wstring {
if res := utf8_to_utf16(s, allocator); res != nil { if res := utf8_to_utf16(s, allocator); len(res) > 0 {
return &res[0] return raw_data(res)
} }
return nil return nil
} }