develooper Front page | perl.perl5.porters | Postings from January 2020

Re: “strict” strings?

Thread Previous | Thread Next
From:
Felipe Gasper
Date:
January 7, 2020 03:02
Subject:
Re: “strict” strings?
Message ID:
006A1728-393C-4A35-A195-38FB5D43570F@felipegasper.com

> On Jan 6, 2020, at 9:43 PM, Tony Cook <tony@develop-help.com> wrote:
> 
> If Sereal converts a SVf_UTF8 off SV-with-PV to a binary specific type in some
> other language, that is a bug in Sereal.  I haven't tried it.

FWIW:

> perl -MSereal::Encoder -e'my $a = "\xc2\xa9"; print encode_sereal($a)' | xxd
00000000: 3df3 726c 0400 62c2 a9                   =.rl..b..

The antepenultimate 0x62 is SHORT_BINARY_2.

> perl -MSereal::Encoder -e'my $a = "\xc2\xa9"; utf8::decode($a); print encode_sereal($a)' | xxd
00000000: 3df3 726c 0400 2702 c2a9                 =.rl..'...

The [0x27 0x02] sequence indicates STR_UTF8, length 2.


And in fact, the module’s POD specifically states that it keys off SVf_UTF8. So there’s that.


-F
Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About