Change is_utf16 field to encoding and use an enum

This commit is contained in:
gingerBill
2025-08-05 15:12:54 +01:00
parent eae43f1225
commit af3184adc9
10 changed files with 33 additions and 13 deletions
+1 -1
View File
@@ -335,7 +335,7 @@ _unmarshal_value :: proc(d: Decoder, v: any, hdr: Header, allocator := context.a
_unmarshal_bytes :: proc(d: Decoder, v: any, ti: ^reflect.Type_Info, hdr: Header, add: Add, allocator := context.allocator, loc := #caller_location) -> (err: Unmarshal_Error) {
#partial switch t in ti.variant {
case reflect.Type_Info_String:
assert(!t.is_utf16)
assert(t.encoding == .UTF_8)
bytes := err_conv(_decode_bytes(d, add, allocator=allocator, loc=loc)) or_return