[interchange] Eval the Encode::PERLQQ module, to avoid errors when it and Encode are not present
Jon Jensen <[email protected]>
| Newsgroups | gmane.comp.web.interchange.cvs |
|---|---|
| Message-ID | <[email protected]> |
commit fae11cbefd29883421a304ab36ed08e40fbdd735 Author: Josh Lavin <[email protected]> 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);