[rt-users] RT 3.8 mangles html attachment

Jesse Vincent jesse at bestpractical.com
Fri Feb 20 16:35:11 EST 2009




On Fri 20.Feb'09 at 14:46:49 -0500, Todd Chapman wrote:
> The attached script and input file trigger the error. I think the
> problem is the loop on @lines. The BOM is only in the first line so
> the rest is cornfused.

If you're up for actually rewriting that as a test file that loads the
data and checks what it creates, I'm game for trying to debug it.

> 
> 
> 
> On Fri, Feb 20, 2009 at 1:43 PM, Jesse Vincent <jesse at bestpractical.com> wrote:
> >> Hmmm. Just noticed this error:
> >>
> >> [Fri Feb 20 18:32:55 2009] [debug]: Converting 'UTF-16' to 'utf-8' for
> >> text/html - Re Eprize RPC interface failing on DC registration.htm
> >> (/opt/rt3-devel/bin/../lib/RT/I18N.pm:234)
> >> [Fri Feb 20 18:32:55 2009] [error]: Encoding error:
> >> UTF-16:Unrecognised BOM 78 at
> >> /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/Encode.pm line 190.
> >
> > How small a test case can you get to fail like that?
> >

> use strict;
> use warnings;
> 
> use RT;
> RT::LoadConfig();
> RT::Init();
> 
> use MIME::Entity;
> use RT::I18N;
> 
>     my $Message = MIME::Entity->build(
>         Type    => 'multipart/mixed',
>         Subject => "foo",
>     );  
> 
> 
> open(my $filehandle, "<", "file") or die;
> 
> my (@content,$buffer);
> while ( my $bytesread = read( $filehandle, $buffer, 4096 ) ) {
>     push @content, $buffer;
> }
> 
> $Message->attach(
>     Type     => "text/html",
>     Filename => 'myfile',
>     Data     => \@content,
> );
> 
> $Message->make_singlepart;
> RT::I18N::SetMIMEEntityToUTF8($Message); # convert text parts into utf-8



-- 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 194 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20090220/c0f92eeb/attachment.sig>


More information about the rt-users mailing list