All pastes #821582 Raw Edit

無名

public text v1 · immutable
·published 2007-12-18 05:41 UTC
rendered paste body
44c44
<     $doc->add_attr('@title' => $args->{entry}->title->utf8);
---
>     $doc->add_attr('@title' => _test_utf8($args->{entry}->title));
46c46
<     $doc->add_attr('@author' => $args->{entry}->author->utf8) if $args->{entry}->author;
---
>     $doc->add_attr('@author' => _test_utf8($args->{entry}->author)) if $args->{entry}->author;
48,49c48,49
<     $doc->add_text($args->{entry}->body->utf8);
<     $doc->add_hidden_text($args->{entry}->title->utf8);
---
>     $doc->add_text(_test_utf8($args->{entry}->body));
>     $doc->add_hidden_text(_test_utf8($args->{entry}->title));
90a91,101
> sub _test_utf8 {
>     my $str = shift;
>     my $result;
>     if (eval {$result = $str->utf8}) {
>         return $result;
>     }
>     else {
>         return $str;
>     }
> }
>