Changeset 3351


Ignore:
Timestamp:
2002-08-13T17:25:35+12:00 (22 years ago)
Author:
jrm21
Message:

If a message is in an unsupported encoding, we assume iso8859-1. Otherwise
we lose all the header metadata, etc, as everything gets converted to "".

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/plugins/EMAILPlug.pm

    r3329 r3351  
    817817      }
    818818  }
    819   $$textref=&unicode::unicode2utf8(&unicode::convert2unicode($charset,$textref));
     819  my $utf8_text=&unicode::unicode2utf8(&unicode::convert2unicode($charset,$textref));
     820
     821  if ($utf8_text ne "") {
     822      $$textref=$utf8_text;
     823  } else {
     824      # we didn't get any text... unsupported encoding perhaps? Or it is
     825      # empty anyway. We'll try to continue, assuming 8859-1. We could strip
     826      # characters out here if this causes problems...
     827      $$textref=&unicode::unicode2utf8(&unicode::convert2unicode("iso_8859_1",$textref));
     828
     829  }
    820830}
    821831
Note: See TracChangeset for help on using the changeset viewer.