Commit 29bd5db6 authored by Ruslan Zakirov's avatar Ruslan Zakirov
Browse files

ok, MIME::Parser is not aware about perl strings, so we use octets.

  What means that we must treat MIME's content as octets everywhere
  and use Encode::decode_utf8

git-svn-id: svn+ssh://svn.bestpractical.com/svn/bps-public/rt/3.8/branches/non-ascii-subject@13509 e417ac7c-1bcc-0310-8ffa-8f5827389a85
parent 421d7960
......@@ -358,10 +358,10 @@ sub _Parse {
### Should we forgive normally-fatal errors?
$parser->ignore_errors(1);
open my $stream, "<:utf8", \$content
or return (0, $self->loc("Couldn't open stream for parsing MIME::Entity: $!"));
# MIME::Parser doesn't play well with perl strings
utf8::encode($content);
$self->{'MIMEObj'} = eval { $parser->parse( $stream ) };
$self->{'MIMEObj'} = eval { $parser->parse_data( \$content ) };
if ( my $error = $@ || $parser->last_error ) {
$RT::Logger->error( "$error" );
return ( 0, $error );
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment