Changeset 2176

Show
Ignore:
Timestamp:
05/01/08 00:41:14 (7 months ago)
Author:
fumiakiy
Message:

Encode text properly according to PublishCharset in the Atom service document. BugId:79241

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/release-36/lib/MT/AtomServer.pm

    r1947 r2176  
    430430        : MT::Permission->load_iter({ author_id => $user->id }); 
    431431    my $base = $app->base . $app->uri; 
     432    my $enc = $app->config->PublishCharset; 
    432433 
    433434    # TODO: libxml support? XPath should always be available... 
     
    458459 
    459460        my $title = XML::XPath::Node::Element->new('atom:title', 'atom'); 
    460         $title->appendChild(XML::XPath::Node::Text->new($blog->name)); 
     461        my $blogname = encode_text($blog->name, $enc, 'utf-8'); 
     462        $title->appendChild(XML::XPath::Node::Text->new($blogname)); 
    461463        $workspace->appendChild($title); 
    462464 
     
    466468 
    467469        my $e_title = XML::XPath::Node::Element->new('atom:title', 'atom'); 
    468         $e_title->appendChild(XML::XPath::Node::Text->new(MT->translate('[_1]: Entries', $blog->name))); 
     470        my $feed_title = encode_text(MT->translate('[_1]: Entries', $blog->name), $enc, 'utf-8'); 
     471        $e_title->appendChild(XML::XPath::Node::Text->new($feed_title)); 
    469472        $entries->appendChild($e_title); 
    470473