+ o Fix UTF-8 double encoding when FCGI is passed octets by downgrading
+ them into bytes correctly. Fixes RT#52400 <chansen@cpan.org>
+
Version 0.68 -- 31 Dec 2009 <mst@shadowcat.co.uk> Matt S Trout
o No changes since the previous development release.
CODE:
for (n = 1; n < items; ++n) {
STRLEN len;
- register char *tmps = (char *)SvPV(ST(n),len);
+ register char *tmps;
+#ifdef DO_UTF8
+ if (DO_UTF8(ST(n)) && !sv_utf8_downgrade(ST(n), 1))
+ croak("Wide character in FCGI::Stream::PRINT");
+#endif
+ tmps = (char *)SvPV(ST(n),len);
FCGX_PutStr(tmps, len, stream);
}
if (SvTRUEx(perl_get_sv("|", FALSE)))
CODE:
offset = (items == 4) ? (int)SvIV(ST(3)) : 0;
+#ifdef DO_UTF8
+ if (DO_UTF8(bufsv) && !sv_utf8_downgrade(bufsv, 1))
+ croak("Wide character in FCGI::Stream::WRITE");
+#endif
buf = SvPV(bufsv, blen);
if (offset < 0) offset += blen;
if (len > blen - offset)
ST(0) = &PL_sv_undef;
else {
ST(0) = sv_newmortal();
- sv_setpvf(ST(0), "%c", n);
+ sv_setiv(ST(0), n);
}
int
CODE:
offset = (items == 4) ? (int)SvIV(ST(3)) : 0;
+#ifdef DO_UTF8
+ if (DO_UTF8(bufsv) && !sv_utf8_downgrade(bufsv, 1))
+ croak("Wide character in FCGI::Stream::READ");
+#endif
if (! SvOK(bufsv))
sv_setpvn(bufsv, "", 0);
buf = SvGROW(bufsv, len+offset+1);