develooper Front page | perl.perl5.porters | Postings from October 2016

Re: Encode.xs and sv_force_normal

Thread Previous | Thread Next
October 25, 2016 16:44
Re: Encode.xs and sv_force_normal
Message ID:
On Tuesday 25 October 2016 06:48:09 Father Chrysostomos wrote:
> On Oct 23, 2016, at 12:42 PM, wrote:
> > For me it makes sense to call SvGETMAGIC/SvSETMAGIC so $/ will be
> > supported too...
> That makes sense to me, too.

Ok. Now I added SvGETMAGIC(sv) before SvPOK(sv) and SvSETMAGIC(sv) after 
SvUTF8_on(sv) (resp. SvUTF8_off(sv)).

I created tests for tied scalars, but in perl 5.14 that tests are 
failing. They pass under bleed perl.

Now I looked deeply and it looks like that perl 5.14 does *not* set 
SvPOK flag for string-tied scalars :-( After calling _utf8_on 
Devel::Peek tell me this:

SV = PVMG(0x1070220) at 0x10eb3d0
  REFCNT = 1

It is some know bug in older perls, that SvPOK is not set after calling 
SvGETMAGIC on string tied scalars?

Or should I use SvPOKp(sv)? Because pPOK is set!

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About