Changeset 1121

Show
Ignore:
Timestamp:
07/21/06 17:04:34
Author:
miyagawa
Message:

Publish::SWF: fixed bug around WrapI18N. added logging

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/plagger/lib/Plagger/Plugin/Publish/SWF.pm

    r1119 r1121  
    2727    my $movie = $self->create_stage($context, $args); 
    2828    $movie->save($file); 
     29    $context->log(info => "SWF file saved as $file"); 
     30 
    2931    return; 
    3032} 
     
    9294    my $page = 0; 
    9395    for my $entry ($args->{feed}->entries) { 
    94         $page++; 
    95         $self->create_page($movie,$page,$entry->title,$entry->body_text); 
     96        $self->create_page($movie, ++$page, $entry->title, $entry->body_text); 
    9697    } 
    9798 
     
    101102sub create_page { 
    102103    my($self, $movie, $page, $title, $body) = @_; 
     104 
     105    $self->log(debug => "Creating page $page ($title)"); 
     106 
    103107    my $font = $self->conf->{font}; 
    104108    my $color = $self->conf->{color} || '000000'; 
     
    106110    my $body_size = $self->conf->{body_size} || 24; 
    107111 
    108     if ($self->conf->{linefeed}) { 
    109         $body = $self->fold_body($body, $self->conf->{linefeed}); 
    110     } 
     112    $body = $self->fold_body($body, $self->conf->{linefeed}); 
    111113 
    112114    my $entry_name = 'entry_text'.$page; 
     
    138140    if (eval { require Text::WrapI18N }) { 
    139141        local $Text::WrapI18N::columns = $length; 
    140         return Text::WrapI18N::wrap('', '', Encode::encode_utf8($str)); 
     142        return Encode::decode_utf8( Text::WrapI18N::wrap('', '', Encode::encode_utf8($str)) ); 
    141143    } else { 
    142144        require Text::Wrap;