diff options
| author | gingerBill <gingerBill@users.noreply.github.com> | 2025-08-05 15:12:54 +0100 |
|---|---|---|
| committer | gingerBill <gingerBill@users.noreply.github.com> | 2025-08-05 15:12:54 +0100 |
| commit | af3184adc96cef59fff986ea6400caa6dbdb56ae (patch) | |
| tree | 7729ec8ac632b9b4bd449978aca997238188e3af /base/runtime | |
| parent | eae43f122556f7219dc05a8fb7674a122ad977ba (diff) | |
Change `is_utf16` field to `encoding` and use an enum
Diffstat (limited to 'base/runtime')
| -rw-r--r-- | base/runtime/core.odin | 7 | ||||
| -rw-r--r-- | base/runtime/print.odin | 5 |
2 files changed, 9 insertions, 3 deletions
diff --git a/base/runtime/core.odin b/base/runtime/core.odin index fe40427ff..478a3d307 100644 --- a/base/runtime/core.odin +++ b/base/runtime/core.odin @@ -61,6 +61,11 @@ Type_Info_Struct_Soa_Kind :: enum u8 { Dynamic = 3, } +Type_Info_String_Encoding_Kind :: enum u8 { + UTF_8 = 0, + UTF_16 = 1, +} + // Variant Types Type_Info_Named :: struct { name: string, @@ -73,7 +78,7 @@ Type_Info_Rune :: struct {} Type_Info_Float :: struct {endianness: Platform_Endianness} Type_Info_Complex :: struct {} Type_Info_Quaternion :: struct {} -Type_Info_String :: struct {is_cstring: bool, is_utf16: bool} +Type_Info_String :: struct {is_cstring: bool, encoding: Type_Info_String_Encoding_Kind} Type_Info_Boolean :: struct {} Type_Info_Any :: struct {} Type_Info_Type_Id :: struct {} diff --git a/base/runtime/print.odin b/base/runtime/print.odin index 85ed49445..2cfb6661b 100644 --- a/base/runtime/print.odin +++ b/base/runtime/print.odin @@ -297,8 +297,9 @@ print_type :: #force_no_inline proc "contextless" (ti: ^Type_Info) { print_byte('c') } print_string("string") - if info.is_utf16 { - print_string("16") + switch info.encoding { + case .UTF_8: /**/ + case .UTF_16: print_string("16") } case Type_Info_Boolean: switch ti.id { |