使用Windows Live Writer在MovableType发表文章出现乱码的解决办法

使用Windows Live Writer在MovableType 4.23 pro发表文章出现会出现乱码,

打开 lib/MT/Util.pm, 大约640行,把函数改下
sub remove_html {
    my($text) = @_;
    return ” if !defined $text;  # suppress warnings
    $text =~ s/(<\!\[CDATA\[(.*?)\]\]>)|(<[^>]+>)/
        defined $1 ? $1 : ”
        /geisx;
    $text =~ s/<(?!\!\[CDATA\[)/&lt;/gis;
    return $text;
}

改成 
sub remove_html {
    my($text) = @_;
    return $text if !defined $text;  # suppress warnings
    return $text if $text =~ m/^<\!\[CDATA\[/i;
    $text =~ s!<[^>]+>!!gs;
    $text =~ s!<!&lt;!gs;
    $text;
}

写博客真难受

Written by gegewan on 三月 18th, 2009 with no comments.
Read more articles on MovableType and Windows Live Writer.

No comments

There are still no comments on this article.

Leave your comment...

If you want to leave your comment on this article, simply fill out the next form:




You can use these XHTML tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> .