ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/JSON-XS/XS.xs
(Generate patch)

Comparing JSON-XS/XS.xs (file contents):
Revision 1.99 by root, Sat Aug 8 10:06:02 2009 UTC vs.
Revision 1.101 by root, Tue Sep 8 18:00:03 2009 UTC

759 : enc.json.flags & F_LATIN1 ? 0x000100UL 759 : enc.json.flags & F_LATIN1 ? 0x000100UL
760 : 0x110000UL; 760 : 0x110000UL;
761 761
762 SvPOK_only (enc.sv); 762 SvPOK_only (enc.sv);
763 encode_sv (&enc, scalar); 763 encode_sv (&enc, scalar);
764 encode_nl (&enc);
764 765
765 SvCUR_set (enc.sv, enc.cur - SvPVX (enc.sv)); 766 SvCUR_set (enc.sv, enc.cur - SvPVX (enc.sv));
766 *SvEND (enc.sv) = 0; // many xs functions expect a trailing 0 for text strings 767 *SvEND (enc.sv) = 0; // many xs functions expect a trailing 0 for text strings
767 768
768 if (!(enc.json.flags & (F_ASCII | F_LATIN1 | F_UTF8))) 769 if (!(enc.json.flags & (F_ASCII | F_LATIN1 | F_UTF8)))
948 else if (expect_true (ch >= 0x20 && ch < 0x80)) 949 else if (expect_true (ch >= 0x20 && ch < 0x80))
949 *cur++ = ch; 950 *cur++ = ch;
950 else if (ch >= 0x80) 951 else if (ch >= 0x80)
951 { 952 {
952 STRLEN clen; 953 STRLEN clen;
953 UV uch;
954 954
955 --dec_cur; 955 --dec_cur;
956 956
957 uch = decode_utf8 (dec_cur, dec->end - dec_cur, &clen); 957 decode_utf8 (dec_cur, dec->end - dec_cur, &clen);
958 if (clen == (STRLEN)-1) 958 if (clen == (STRLEN)-1)
959 ERR ("malformed UTF-8 character in JSON string"); 959 ERR ("malformed UTF-8 character in JSON string");
960 960
961 do 961 do
962 *cur++ = *dec_cur++; 962 *cur++ = *dec_cur++;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines