From: Jarkko Hietaniemi Date: Mon, 18 Jun 2001 23:10:22 +0000 (+0000) Subject: Document the need for sv_printify(). X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0562c0e3630958db13a0e70db1b90c05d3fee158;p=p5sagit%2Fp5-mst-13.2.git Document the need for sv_printify(). Document that 'use utf8' has been considered. (An unfinished, gcc 3.0 -Wall nit fix also slipped in, gack.) p4raw-id: //depot/perl@10698 --- diff --git a/pod/perltodo.pod b/pod/perltodo.pod index 3882498..5d280e6 100644 --- a/pod/perltodo.pod +++ b/pod/perltodo.pod @@ -28,6 +28,12 @@ always be set to true, but it needs to be set to false when F is being compiled. (To stop Perl trying to autoload the C pragma...) +=head2 Create a char *sv_printify(sv, STRLEN *lenp, UV flags) function + +For displaying PVs with control characters, embedded nulls, and Unicode. +This would be useful for printing warnings, or data and regex dumping, +not_a_number(), and so on. + =head2 Autoload byte.pm When the lexer sees, for instance, C, it should @@ -770,3 +776,13 @@ done manually, with C. (However, MJD has found that C introduces a performance penalty, so maybe there should be a way to do this after all: C is better.) + +=head2 Make "use utf8" the default + +There is a patch available for this, search p5p archives for +the Subject "[EXPERIMENTAL PATCH] make unicode (utf8) default" +but this would be unacceptable because of backward compatibility: +scripts could not contain B. Also would +introduce a measurable slowdown of at least few percentages since all +regular expression operations would be done in full UTF-8. + diff --git a/universal.c b/universal.c index ca69243..8b20443 100644 --- a/universal.c +++ b/universal.c @@ -303,9 +303,10 @@ XS(XS_UNIVERSAL_VERSION) sv_setnv(req, n); } - if (SvNV(req) > SvNV(sv)) + if (SvNV(req) > SvNV(sv)) { Perl_croak(aTHX_ "%s version %s required--this is only version %s", - HvNAME(pkg), SvPV(req,len), SvPV(sv,len)); + HvNAME(pkg), SvPV_nolen(req), SvPV_nolen(sv,len)); + } } finish: