使用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\[)/</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!<!<!gs;
$text;
}
写博客真难受
Written by gegewan on 三月 18th, 2009 with
no comments.
Read more articles on MovableType and Windows Live Writer.
- [+] Digg: Feature this article
- [+] Del.icio.us: Bookmark this article
- [+] Furl: Bookmark this article