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.



On Fri, Feb 20, 2009 at 1:43 PM, Jesse Vincent <[email protected]> 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

Attachment: file
Description: Binary data

_______________________________________________
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: [email protected]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com

Reply via email to