Groups | Search | Server Info | Login | Register


Groups > perl.pep > #62

behavior change regarding quoted strings

Newsgroups perl.pep
Date 2018-05-11 18:52 +0000
Subject behavior change regarding quoted strings
Message-ID <20180511185213.GA23717@dcvr> (permalink)
From e@80x24.org (Eric Wong)

Show all headers | View raw


Hello, I noticed a behavior change somewhere in the Email::MIME
stack when header_str_set is passed a string with a single-quote
(') character in it.

On my Debian stable (stretch) machine the behavior is to
leave the single quote alone.  On Debian unstable/sid,
a backslash is added before the single-quote.

Changes from stretch to current sid are as follows:

perl (including Encode.pm)      5.24.1-3+deb9u3 -> 5.26.2-3
libemail-mime-perl              1.937-1 -> 1.946-1

unchanged:

libemail-mime-encodings-perl    1.315-1 -> 1.315-2
	(only Debian-specific packaging changes, I suspect)


I think the old behavior (not adding backslash) is correct, but
I'm not sure.  I can work around the problem with "header_set"
instead.

	use strict;
	use warnings;
	use Email::MIME;
	my $mime = Email::MIME->create;
	my $h = 'From';
	my $n = q("Quoted N'Ame" <foo@EXAMPLE.com>);
	$mime->header_str_set($h, $n);
	print $mime->header($h), "\n"; # adds backslash to '

Konstantin hit this with public-inbox on CentOS but using newer
modules from CPAN and older Perl:
https://public-inbox.org/meta/2a2bf0e1-fd1f-f8bf-95bc-dac47906ef43@linuxfoundation.org/

	# cpanm --info Email::MIME
	RJBS/Email-MIME-1.946.tar.gz
	# cpanm --info Email::MIME::Encodings
	RJBS/Email-MIME-Encodings-1.315.tar.gz
	# cpanm --info Email::Simple
	RJBS/Email-Simple-2.214.tar.gz
	# perl --version

	This is perl 5, version 16, subversion 3 (v5.16.3) built for
	x86_64-linux-thread-multi
	(with 33 registered patches, see perl -V for more detail)

Back to perl.pep | Previous | NextNext in thread | Find similar


Thread

behavior change regarding quoted strings e@80x24.org (Eric Wong) - 2018-05-11 18:52 +0000
  Re: behavior change regarding quoted strings pali@cpan.org - 2018-05-15 13:53 +0200
    Re: behavior change regarding quoted strings e@80x24.org (Eric Wong) - 2018-05-16 10:50 +0000
      Re: behavior change regarding quoted strings pali@cpan.org - 2018-05-19 15:27 +0200
        Re: behavior change regarding quoted strings e@80x24.org (Eric Wong) - 2018-05-24 05:28 +0000
          Re: behavior change regarding quoted strings pali@cpan.org - 2018-05-25 15:39 +0200
            Re: behavior change regarding quoted strings pali@cpan.org - 2018-06-14 00:24 +0200

csiph-web