Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Interchange: users

Email.tag and Encode patch

 

 

Interchange users RSS feed   Index | Next | Previous | View Threaded


josh at perusion

May 30, 2012, 4:58 PM

Post #1 of 2 (171 views)
Permalink
Email.tag and Encode patch

When _not_ using UTF8, I found that the latest email.tag only worked for
me when Encode had already been included, because I had a filter with
"use Encode". When that filter was removed, the email.tag failed with:

Undefined subroutine &Encode::PERLQQ called at (tag 'email') line 11.

I am more than willing for others to provide insight into a better way
to fix, but this patch works for me:

https://github.com/jlavin/interchange/commit/b8eec1f7279742930acc11e8064a3eaf870b5210

--- a/code/UserTag/email.tag
+++ b/code/UserTag/email.tag
@@ -1,4 +1,4 @@
-# Copyright 2002-2010 Interchange Development Group and others
+# Copyright 2002-2012 Interchange Development Group and others
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -11,17 +11,21 @@ UserTag email addAttr
UserTag email Interpolate
UserTag email Routine <<EOR

-my $Have_mime_lite;
+my ($Have_mime_lite, $Have_encode);
BEGIN {
eval {
require MIME::Lite;
$Have_mime_lite = 1;
};
+ eval {
+ require Encode::PERLQQ;
+ $Have_encode = 1;
+ };
}

sub utf8_to_other {
my ($string, $encoding) = @_;
- return $string unless defined Encode::PERLQQ(); # nop if no Encode
+ return $string unless $Have_encode; # nop if no Encode

unless(Encode::is_utf8($string)){
$string = Encode::decode('utf-8', $string);


--
Josh Lavin
Perusion -- Expert Interchange Consulting http://www.perusion.com/

_______________________________________________
interchange-users mailing list
interchange-users [at] icdevgroup
http://www.icdevgroup.org/mailman/listinfo/interchange-users


jon at endpoint

Jun 27, 2012, 6:47 PM

Post #2 of 2 (142 views)
Permalink
Re: Email.tag and Encode patch [In reply to]

On Wed, 30 May 2012, Josh Lavin wrote:

> When _not_ using UTF8, I found that the latest email.tag only worked for
> me when Encode had already been included, because I had a filter with
> "use Encode".

Thanks for the good patch, Josh. I just pushed it to the central repo.

We need to get your commit bit going! :)

Jon

--
Jon Jensen
End Point Corporation
http://www.endpoint.com/
+1 507-399-0057

_______________________________________________
interchange-users mailing list
interchange-users [at] icdevgroup
http://www.icdevgroup.org/mailman/listinfo/interchange-users

Interchange users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.