Changeset 5601
- Timestamp:
- 01/27/08 09:47:18 (5 years ago)
- Location:
- lang/perl/mobirc/trunk/mobirc
- Files:
-
- 3 modified
-
Makefile.PL (modified) (1 diff)
-
lib/Mobirc/HTTPD.pm (modified) (1 diff)
-
lib/Mobirc/HTTPD/Controller.pm (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/mobirc/trunk/mobirc/Makefile.PL
r5094 r5601 35 35 requires 'CSS::Tiny'; 36 36 requires 'Encode::JP::Mobile'; 37 requires 'HTTP::MobileAgent::Plugin::Charset'; 37 38 38 39 features( -
lang/perl/mobirc/trunk/mobirc/lib/Mobirc/HTTPD.pm
r1697 r5601 20 20 use UNIVERSAL::require; 21 21 use HTTP::MobileAgent; 22 use HTTP::MobileAgent::Plugin::Charset; 22 23 23 24 use Mobirc; -
lang/perl/mobirc/trunk/mobirc/lib/Mobirc/HTTPD/Controller.pm
r5470 r5601 15 15 use List::Util qw/first/; 16 16 use Template::Provider::Encoding; 17 use Encode::JP::Mobile 0.24; 17 18 18 19 use Mobirc; … … 128 129 my $r = CGI->new( $c->{req}->content ); 129 130 my $message = $r->param('msg'); 130 $message = decode( _get_charset($c), $message );131 $message = decode( $c->{mobile_agent}->encoding, $message ); 131 132 132 133 DEBUG "POST MESSAGE $message"; … … 239 240 DEBUG "rendering done"; 240 241 241 my $content = encode( _get_charset($c), $out);242 my $content = encode( $c->{mobile_agent}->encoding, $out); 242 243 $content = _html_filter($c, $content); 243 244 … … 328 329 } 329 330 330 # FIXME I want to use HTTP::MobileAgent::Plugin::Charset331 sub _get_charset {332 my ($c, ) = @_;333 334 my $charset = $c->{config}->{httpd}->{charset} || 'shift_jis-mobile-auto';335 336 if ($charset =~ /^shift_jis-.+/) {337 require Encode::JP::Mobile;338 }339 340 if ($charset eq 'shift_jis-mobile-auto') {341 my $agent = $c->{mobile_agent};342 if ($agent->is_non_mobile) {343 $charset = 'utf8';344 } else {345 $charset = 'shift_jis-' . lc $agent->carrier_longname;346 }347 }348 349 DEBUG "use charset: $charset";350 351 return $charset;352 }353 354 331 1;
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)