Skip to main content

decode_json_string

Function decode_json_string 

Source
pub fn decode_json_string(src: &str) -> String
Expand description

C yajl_string_decode (yajl_encode.c:136-215): decode the CONTENT of a JSON string (no surrounding quotes).

Base’s yajl is the JSON5-extended one, so beyond the standard escapes it takes \v, \0, \xHH, and a backslash-newline line continuation. An unknown escape yields the escaped character itself (yajl’s default arm), which is what makes \", \' and \/ work without their own cases.

KNOWN DEVIATION (R19-68, tracked separately): \xHH with HH >= 0x80 is ONE byte in C (utf8Buf[0] = (char) codepoint) and two UTF-8 bytes here, because this returns a String. That is the same byte-model gap crate::runtime::epics_string documents, and it is fixed in one place for both decoders, not here.