summaryrefslogtreecommitdiffstats
path: root/staticweb/man.pl
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-12-16 14:51:38 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-12-16 14:51:38 +0800
commit6586626ac878e99b9e3f5f15ac5ec37cd7484831 (patch)
treefca68420fa85ce89d84f723354d2feacd99e60e4 /staticweb/man.pl
parentd9a7b30d990e2bab67413fe11acb2d9f7096a61a (diff)
downloadpttbbs-6586626ac878e99b9e3f5f15ac5ec37cd7484831.tar
pttbbs-6586626ac878e99b9e3f5f15ac5ec37cd7484831.tar.gz
pttbbs-6586626ac878e99b9e3f5f15ac5ec37cd7484831.tar.bz2
pttbbs-6586626ac878e99b9e3f5f15ac5ec37cd7484831.tar.lz
pttbbs-6586626ac878e99b9e3f5f15ac5ec37cd7484831.tar.xz
pttbbs-6586626ac878e99b9e3f5f15ac5ec37cd7484831.tar.zst
pttbbs-6586626ac878e99b9e3f5f15ac5ec37cd7484831.zip
better big5=>gb2312 implementation
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1415 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'staticweb/man.pl')
-rwxr-xr-xstaticweb/man.pl16
1 files changed, 11 insertions, 5 deletions
diff --git a/staticweb/man.pl b/staticweb/man.pl
index 6afb7410..003f7ebf 100755
--- a/staticweb/man.pl
+++ b/staticweb/man.pl
@@ -59,7 +59,17 @@ sub main
$rh->{lang} = 'zh_TW';
$rh->{charset} = 'big5';
}
- $tmpl->process($rh->{tmpl}, $rh);
+
+ if( !$rh->{gb} ){
+ $tmpl->process($rh->{tmpl}, $rh);
+ }
+ else{
+ my $output;
+ $tmpl->process($rh->{tmpl}, $rh, \$output);
+ b2g::big5togb($output);
+ print $output;
+ }
+
untie %db;
}
@@ -71,8 +81,6 @@ sub dirmode
compress => 0,
);
foreach( @{$serial->deserialize($db{$fpath}) || []} ){
- $_->[1] =~ s/([\xA1-\xF9].)/$b2g{$1}/eg if( $isgb );
- #Encode::from_to($_->[1], 'big5', 'gbk') if( $isgb );
$isdir = (($_->[0] =~ m|/$|) ? 1 : 0);
push @{$th{dat}}, {isdir => $isdir,
fn => "man.pl/$brdname$_->[0]",
@@ -108,8 +116,6 @@ sub articlemode
$th{content} =~
s|ptt\.twbbs\.org|<a href="telnet://ptt.cc">ptt.twbbs.org</a>|gs;
- $th{content} =~ s/([\xA1-\xF9].)/$b2g{$1}/eg if( $isgb );
- #Encode::from_to($th{content}, 'big5', 'gbk') if( $isgb );
return \%th;
}