diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2002-03-07 22:37:51 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2002-03-07 22:37:51 +0000 |
commit | 799ef3cbf1e54d039c2681bb415c66a8acfbc6cd (patch) | |
tree | e300409ec36e330b6f2b305d2e662e2ebfa4b58f /pp.c | |
parent | cf48d248eb62e81239204ca4ca6b33029875e0bd (diff) | |
download | perl-799ef3cbf1e54d039c2681bb415c66a8acfbc6cd.tar.gz |
As suggested by Anton Tagunov, eq and cmp now obey the
encoding pragma (by remapping their byte argument if the
other argument is in Unicode). Also fix a bug found by
Anton where ord undef under the encoding pragma would barf.
([ID 20020307.009] A null pointer dereference with 'use encoding')
Finally, use the nicer form of sv_recode_to_utf8.
p4raw-id: //depot/perl@15085
Diffstat (limited to 'pp.c')
-rw-r--r-- | pp.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -3147,9 +3147,9 @@ PP(pp_ord) U8 *s = (U8*)SvPVx(argsv, len); SV *tmpsv; - if (PL_encoding && !DO_UTF8(argsv)) { + if (PL_encoding && SvPOK(argsv) && !DO_UTF8(argsv)) { tmpsv = sv_2mortal(newSVsv(argsv)); - s = (U8*)Perl_sv_recode_to_utf8(aTHX_ tmpsv, PL_encoding); + s = (U8*)sv_recode_to_utf8(tmpsv, PL_encoding); argsv = tmpsv; } @@ -3184,7 +3184,7 @@ PP(pp_chr) *tmps = '\0'; (void)SvPOK_only(TARG); if (PL_encoding) - Perl_sv_recode_to_utf8(aTHX_ TARG, PL_encoding); + sv_recode_to_utf8(TARG, PL_encoding); XPUSHs(TARG); RETURN; } |