Changeset 744

Show
Ignore:
Timestamp:
09/02/02 17:31:10
Author:
miyagawa
Message:

0.02

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Apache-DefaultCharset/trunk/Apache-Test/lib/Apache/TestCharset.pm

    r653 r744  
    77    my $charset = Apache::DefaultCharset->new($r); 
    88    $r->send_http_header; 
    9     $r->print("charset:$charset"); 
     9    $r->print("charset:$charset\n"); 
     10    $r->print("charset_r:", $r->add_default_charset_name, "\n"); 
    1011} 
    1112 
  • Apache-DefaultCharset/trunk/Changes

    r653 r744  
    11Revision history for Perl extension Apache::DefaultCharset 
     2 
     30.02  Mon Sep  2 17:30:08 JST 2002 
     4        * Add add_default_charset_name() into Apache package 
    25 
    360.01  Fri May 31 04:47:01 2002 
  • Apache-DefaultCharset/trunk/MANIFEST

    r653 r744  
    55MANIFEST                        This list of files 
    66Makefile.PL 
     7README 
    78lib/Apache/DefaultCharset.pm 
    89t/00_compile.t 
  • Apache-DefaultCharset/trunk/lib/Apache/DefaultCharset.pm

    r653 r744  
    33use strict; 
    44use vars qw($VERSION); 
    5 $VERSION = 0.01
     5$VERSION = 0.02
    66 
    77require DynaLoader; 
     
    2525} 
    2626 
     27package Apache; 
     28 
     29sub add_default_charset_name { 
     30    my $r = shift; 
     31    if (@_ == 1) { 
     32        Apache::DefaultCharset::_set($r, @_); 
     33    } else { 
     34        return Apache::DefaultCharset::_get($r); 
     35    } 
     36} 
     37 
    27381; 
    2839__END__ 
     
    3647  use Apache::DefaultCharset; 
    3748 
    38   my $charset = Apache::DefaultCharset->new($r); 
     49  # This module adds "add_default_charset_name" method 
     50  $charset = $r->add_default_charset_name; 
     51  $r->add_default_charset_name('euc-jp'); 
     52 
     53  # via Apache::DefaultCharset object 
     54  $charset = Apache::DefaultCharset->new($r); 
    3955  print "default_charset_name is ", $charset->name; 
    4056  # or print "default charset is $charset"; will do (overload) 
     57  $charset->name('euc-jp'); 
    4158 
    42   $charset->name('euc-jp');     # modify default_charset_name in run-time 
    4359 
    4460=head1 DESCRIPTION 
  • Apache-DefaultCharset/trunk/t/01_get.t

    r653 r744  
    33use Apache::TestRequest; 
    44 
    5 plan tests => 2, have_lwp; 
     5plan tests => 4, have_lwp; 
    66 
    77{ 
    88    my $body = GET_BODY "/euc-jp/index.html"; 
    99    ok($body, qr/charset:euc-jp/); 
     10    ok($body, qr/charset_r:euc-jp/); 
    1011} 
    1112 
     
    1314    my $body = GET_BODY "/utf-8/index.html"; 
    1415    ok($body, qr/charset:utf-8/); 
     16    ok($body, qr/charset_r:utf-8/); 
    1517} 
    1618