Skip Menu |

This queue is for tickets about the MailTools CPAN distribution.

Report information
The Basics
Id: 30661
Status: resolved
Priority: 0/
Queue: MailTools

People
Owner: Nobody in particular
Requestors: jclark [...] globalmoxie.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 2.00_03
Fixed in: (no value)



Subject: Mail::Address _tokenise(): "Unrecognised line: foo@bar.com" for UTF8 strings in 5.8.0
In Mail::Address, _tokenise() occasionally croaks with "unrecognised line" under Perl 5.8.0 if the argument has its utf8 flag set (e.g. via Encode::decode('utf8', $text)). This appears to be due to 5.8.0's buggy handling of regex with utf8 strings. Borrowing a fix from _extract_name() in Mail::Address appears to address the issue: sub _tokenise { local($_) = join(',', @_); # utf8 strings in 5.8.0 can trigger 'Unrecognised line' message if($] eq 5.008) { require utf8; utf8::downgrade($_); } ... Best, Josh
Subject: Re: [rt.cpan.org #30661] Mail::Address _tokenise(): "Unrecognised line: foo@bar.com" for UTF8 strings in 5.8.0
Date: Mon, 12 Nov 2007 15:03:33 +0100
To: "jclark [...] globalmoxie.com via RT" <bug-MailTools [...] rt.cpan.org>
From: Mark Overmeer <solutions [...] overmeer.net>
* jclark@globalmoxie.com via RT (bug-MailTools@rt.cpan.org) [071112 08:50]: Show quoted text
> Mon Nov 12 03:50:30 2007: Request 30661 was acted upon. > Transaction: Ticket created by jclark@globalmoxie.com > Queue: MailTools > Subject: Mail::Address _tokenise(): "Unrecognised line: foo@bar.com" for > UTF8 strings in 5.8.0 > Broken in: 2.00_03 > Severity: Normal > Owner: Nobody > Requestors: jclark@globalmoxie.com > Status: new > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=30661 > > > In Mail::Address, _tokenise() occasionally croaks with "unrecognised > line" under Perl 5.8.0 if the argument has its utf8 flag set (e.g. via > Encode::decode('utf8', $text)). This appears to be due to 5.8.0's buggy > handling of regex with utf8 strings. > > Borrowing a fix from _extract_name() in Mail::Address appears to address > the issue: > > sub _tokenise { > local($_) = join(',', @_); > > # utf8 strings in 5.8.0 can trigger 'Unrecognised line' message > if($] eq 5.008) { > require utf8; > utf8::downgrade($_); > }
I have no desire to be bug-compatible with such old releases (5.8.0 was released on 18 Jul 2002 (see perlhist), 5.8.1 was released in 25 sept 2003. More than 4 years old. There are many reasons to upgrade if any form of unicode comes in. For the next release, I will update the requirement to 5.8.1 and remove the work-around in _extract_name(). Older Perl versions should use 1.xx MailTool releases, which I may maintain. -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
Subject: Re: [rt.cpan.org #30661] Mail::Address _tokenise(): "Unrecognised line: foo@bar.com" for UTF8 strings in 5.8.0
Date: Mon, 12 Nov 2007 15:33:30 +0100
To: bug-MailTools [...] rt.cpan.org
From: Josh Clark <jclark [...] globalmoxie.com>
Mark, Show quoted text
> For the next release, I will update the requirement to 5.8.1 and > remove the work-around in _extract_name(). Older Perl versions > should use 1.xx MailTool releases, which I may maintain.
That's a totally sensible approach. For what it's worth, if you do choose to maintain the 1.x series for older versions, you might consider adding the suggested patch in a 1.78 release to soothe this particular issue under 5.8.0, since the issue is also present in v1.77. If not, hey, I get it. Lord knows 5.8.0 is a handful when it comes to utf8. Agreed that upgrading is the preferred thing to do; alas, I'm working on some distributed code that often gets installed in hosted environments where the customer cannot control the Perl version, and they limp along with old distros (sometimes very old). Headaches ensue. Thanks for all you do, Josh
Subject: Re: [rt.cpan.org #30661] Mail::Address _tokenise(): "Unrecognised line: foo@bar.com" for UTF8 strings in 5.8.0
Date: Mon, 12 Nov 2007 15:37:24 +0100
To: "jclark [...] globalmoxie.com via RT" <bug-MailTools [...] rt.cpan.org>
From: Mark Overmeer <solutions [...] overmeer.net>
* jclark@globalmoxie.com via RT (bug-MailTools@rt.cpan.org) [071112 14:34]: Show quoted text
> Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=30661 > > If not, hey, I get it. Lord knows 5.8.0 is a handful when it comes to > utf8. Agreed that upgrading is the preferred thing to do; alas, I'm > working on some distributed code that often gets installed in hosted > environments where the customer cannot control the Perl version, and > they limp along with old distros (sometimes very old). Headaches ensue.
Nothing new is the computer world. Let's hope 5.10.0 is better than 5.8.0; probably it is (thanks to Andreas' BBC) -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
Fixed in 1.78 (if it ever comes out, no plans yet) 2.00 will require perl 5.8.1, and thereby avoid the need for this work-around.