… | |
… | |
837 | encode_rv (enc, SvRV (sv)); |
837 | encode_rv (enc, SvRV (sv)); |
838 | else if (!SvOK (sv) || enc->json.flags & F_ALLOW_UNKNOWN) |
838 | else if (!SvOK (sv) || enc->json.flags & F_ALLOW_UNKNOWN) |
839 | encode_str (enc, "null", 4, 0); |
839 | encode_str (enc, "null", 4, 0); |
840 | else |
840 | else |
841 | croak ("encountered perl type (%s,0x%x) that JSON cannot handle, you might want to report this", |
841 | croak ("encountered perl type (%s,0x%x) that JSON cannot handle, you might want to report this", |
842 | SvPV_nolen (sv), SvFLAGS (sv)); |
842 | SvPV_nolen (sv), (unsigned int)SvFLAGS (sv)); |
843 | } |
843 | } |
844 | |
844 | |
845 | static SV * |
845 | static SV * |
846 | encode_json (SV *scalar, JSON *json) |
846 | encode_json (SV *scalar, JSON *json) |
847 | { |
847 | { |
… | |
… | |
1605 | pv_uni_display (uni, dec.cur, dec.end - dec.cur, 20, UNI_DISPLAY_QQ); |
1605 | pv_uni_display (uni, dec.cur, dec.end - dec.cur, 20, UNI_DISPLAY_QQ); |
1606 | LEAVE; |
1606 | LEAVE; |
1607 | |
1607 | |
1608 | croak ("%s, at character offset %d (before \"%s\")", |
1608 | croak ("%s, at character offset %d (before \"%s\")", |
1609 | dec.err, |
1609 | dec.err, |
1610 | ptr_to_index (string, dec.cur), |
1610 | (int)ptr_to_index (string, dec.cur), |
1611 | dec.cur != dec.end ? SvPV_nolen (uni) : "(end of string)"); |
1611 | dec.cur != dec.end ? SvPV_nolen (uni) : "(end of string)"); |
1612 | } |
1612 | } |
1613 | |
1613 | |
1614 | sv = sv_2mortal (sv); |
1614 | sv = sv_2mortal (sv); |
1615 | |
1615 | |