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

Mailing List Archive: Interchange: cvs

[interchange] Eval the Encode::PERLQQ module, to avoid errors when it and Encode are not present

 

 

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


interchange-cvs at icdevgroup

Jun 27, 2012, 6:45 PM

Post #1 of 1 (273 views)
Permalink
[interchange] Eval the Encode::PERLQQ module, to avoid errors when it and Encode are not present

commit fae11cbefd29883421a304ab36ed08e40fbdd735
Author: Josh Lavin <josh [at] perusion>
Date: Wed May 30 16:41:25 2012 -0700

Eval the Encode::PERLQQ module, to avoid errors when it and Encode are not present

code/UserTag/email.tag | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/code/UserTag/email.tag b/code/UserTag/email.tag
index 1b9e5d3..d99a675 100644
--- 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);

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

Interchange cvs 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.