--- JSON-XS/XS.xs 2009/08/08 10:06:02 1.99 +++ JSON-XS/XS.xs 2009/09/05 23:00:56 1.100 @@ -761,6 +761,7 @@ SvPOK_only (enc.sv); encode_sv (&enc, scalar); + encode_nl (&enc); SvCUR_set (enc.sv, enc.cur - SvPVX (enc.sv)); *SvEND (enc.sv) = 0; // many xs functions expect a trailing 0 for text strings