Changeset 247

Show
Ignore:
Timestamp:
09/18/01 04:38:24
Author:
miyagawa
Message:

add SJIS_UTF8

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Apache-ACEProxy/trunk/Changes

    r217 r247  
    11Revision history for Perl extension Apache::ACEProxy. 
     2 
     30.02 
     4        * added SJIS_RACE implementation 
     5        - add docs about startup.pl  configuration 
     6        - rename RACE to UTF8_RACE 
     7        - documentation improved 
    28 
    390.01  Sun Aug 19 08:11:43 2001 
    410        - original version; created by h2xs 1.19 
    511 
     12 
     13 
  • Apache-ACEProxy/trunk/README

    r217 r247  
    88DESCRIPTION 
    99    Apache::ACEProxy is a mod_perl based HTTP proxy server, which handles 
    10     internatilnalized domain names correctly. This module automaticaly 
    11     detects IDNs in Host: header and converts them in ACE encoding. 
     10    internationalized domain names correctly. This module automaticaly 
     11    detects IDNs in HTTP requests and converts them in ACE encoding. Host: 
     12    headers in HTTP requests are also encoded in ACE. 
    1213 
    1314    Set your browser's proxy setting to Apache::ACEProxy based server, and 
     
    1516 
    1617SUBCLASSING 
    17     Default ACE encoding is ACE. Here's how you customize this. 
     18    Default ACE encoding is RACE. Here's how you customize this. 
    1819 
    1920    *   Declare your ACE encoder class (like DUDE, AMC-ACE-Z). 
     
    2122    *   Inherit from Apache::ACEProxy. 
    2223 
    23     *   Define "encde()" class method. 
     24    *   Define "encode()" class method. 
    2425 
    2526    That's all. Here's an example of implementation, extracted from 
     
    3738      } 
    3839 
    39     Not that you should define "encode()" method as a class method. Argument 
    40     $domain is a (maybe UTF8) string that your browser sends to the proxy 
    41     server. 
     40    Note that you should define "encode()" method as a class method. 
     41    Argument $domain is a (maybe UTF8) string that your browser sends to the 
     42    proxy server. 
    4243 
    4344    At last, remember to add the following line to httpd.conf or so: 
    4445 
    45       PerlHandler Apache::ACEProxy::RACE 
     46      PerlTransHandler Apache::ACEProxy::RACE 
    4647 
    4748CAVEATS 
     
    5556 
    5657    So, this proxy server doesn't always work well with all the domains for 
    57     all the browsers. 
     58    all the browsers. If you figure out how your browser encodes 
     59    multilingual domain names, you can write your custom translator as in 
     60    the section on "SUBCLASSING". 
    5861 
    59     Suggestions, patches and reports are welcome about this fact
     62    Suggestions, patches and reports are welcome about this issue
    6063 
    6164AUTHOR 
     
    6568    under the same terms as Perl itself. 
    6669 
    67     This module comes with NO WARANTY. 
     70    This module comes with NO WARRANTY. 
    6871 
    6972SEE ALSO 
  • Apache-ACEProxy/trunk/lib/Apache/ACEProxy.pm

    r220 r247  
    7777    my($class, $domain) = @_; 
    7878 
    79     # Default to RACE 
    80     require Apache::ACEProxy::RACE; 
    81     Apache::ACEProxy::RACE->encode($domain); 
     79    # Default to UTF8_RACE 
     80    require Apache::ACEProxy::UTF8_RACE; 
     81    Apache::ACEProxy::UTF8_RACE->encode($domain); 
    8282} 
    8383 
     
    9292 
    9393  # in httpd.conf 
    94   PerlTransHandler Apache::ACEProxy # default uses ::RACE 
     94  PerlTransHandler Apache::ACEProxy # default uses ::UTF8_RACE 
    9595 
    9696=head1 DESCRIPTION 
     
    9898Apache::ACEProxy is a mod_perl based HTTP proxy server, which handles 
    9999internationalized domain names correctly. This module automaticaly 
    100 detects IDNs in Host: header and converts them in ACE encoding. 
     100detects IDNs in HTTP requests and converts them in ACE encoding. Host: 
     101headers in HTTP requests are also encoded in ACE. 
    101102 
    102103Set your browser's proxy setting to Apache::ACEProxy based server, and 
     
    105106=head1 SUBCLASSING 
    106107 
    107 Default ACE encoding is RACE. Here's how you customize this. 
     108Default ACE conversion is done from UTF8 to RACE. Here's how you 
     109customize this. 
    108110 
    109111=over 4 
     
    124126 
    125127That's all. Here's an example of implementation, extracted from 
    126 Apache::ACEProxy::RACE. 
     128Apache::ACEProxy::UTF8_RACE. 
    127129 
    128   package Apache::ACEProxy::RACE; 
     130  package Apache::ACEProxy::UTF8_RACE; 
    129131 
    130132  use base qw(Apache::ACEProxy); 
     
    137139  } 
    138140 
    139 Not that you should define C<encode()> method as a class 
     141Note that you should define C<encode()> method as a class 
    140142method. Argument $domain is a (maybe UTF8) string that your browser 
    141143sends to the proxy server. 
     
    143145At last, remember to add the following line to httpd.conf or so: 
    144146 
    145   PerlTransHandler Apache::ACEProxy::RACE 
     147  PerlTransHandler Apache::ACEProxy::UTF8_RACE 
    146148 
    147149=head1 CAVEATS 
    148150 
    149 This module (at least Apache::ACEProxy::RACE) assumes input domain 
     151The default Apache::ACEProxy::UTF8_RACE assumes that input domain 
    150152names are encoded in UTF8. But currently it's known that: 
    151153 
     
    154156=item * 
    155157 
    156 MSIE's "always send URL as UTF8" preference does NOT ALWAYS send 
     158MSIE's "always send URL as UTF8" preference does B<NOT ALWAYS> send 
    157159correct UTF8 string. 
    158160 
    159161=item * 
    160162 
    161 Netscape 4.x does NOT send URL as UTF8, but in local encodings. 
     163Netscape 4.x does B<NOT> send URL as UTF8, but in local encodings. 
    162164 
    163165=back 
    164166 
    165167So, this proxy server doesn't always work well with all the domains 
    166 for all the browsers. 
     168for all the browsers. If you figure out how your browser encodes 
     169multilingual domain names, you can write your custom translator as in 
     170L</"SUBCLASSING">. See also L<Apache::ACEProxy::SJIS_RACE> if your 
     171mother language is Japanese. 
    167172 
    168 Suggestions, patches and reports are welcome about this fact
     173Suggestions, patches and reports are welcome about this issue
    169174 
    170175=head1 AUTHOR 
     
    179184=head1 SEE ALSO 
    180185 
    181 L<Apache::ProxyPassThru>, L<LWP::UserAgent>, L<Unicode::String>, L<Apache::ACEProxy::RACE> 
     186L<Apache::ProxyPassThru>, L<LWP::UserAgent>, L<Unicode::String>, L<Apache::ACEProxy::UTF8_RACE>, L<Apache::ACEProxy::SJIS_RACE> 
    182187 
    183188=cut 
  • Apache-ACEProxy/trunk/lib/Apache/ACEProxy/RACE.pm

    r220 r247  
    55$VERSION = '0.01'; 
    66 
    7 use base qw(Apache::ACEProxy); 
    8  
    9 use Convert::RACE qw(to_race); 
    10 use Unicode::String qw(utf8); 
    11  
    12 sub encode { 
    13     my($class, $domain) = @_; 
    14     return to_race(utf8($domain)->utf16); 
    15 
     7use base qw(Apache::ACEProxy::UTF8_RACE); # backward compatibility 
    168 
    1791; 
     
    2416=head1 SYNOPSIS 
    2517 
    26   # in httpd.conf 
    27   PerlTransHandler Apache::ACEProxy::RACE 
     18This module is B<deprecated>. Use Apache::ACEProxy::UTF8_RACE instead. 
    2819 
    2920=head1 DESCRIPTION 
    3021 
    31 Apache::ACEProxy::RACE is one of the implementations of 
    32 Apache::ACEProxy. This module encodes domain names in RACE encoding, 
    33 specified in C<draft-ietf-idn-race-03.txt>. 
    34  
    35 RACE encoding is currently tested domain name encoding by some 
    36 regitrars. Note that this may (possibly, will) be changed if an ACE is 
    37 chosen as the standard. See http://www.i-d-n.net/ for the details. 
    38  
    3922=head1 CAVEATS 
    40  
    41 Works well only for browsers which sends URL as UTF8. See 
    42 L<Apache::ACEProxy/"CAVEATS"> for details. 
    4323 
    4424=head1 AUTHOR 
     
    5333=head1 SEE ALSO 
    5434 
    55 L<Unicode::String>, L<Convert::RACE>, L<Apache::ACEProxy
     35L<Apache::ACEProxy::UTF8_RACE
    5636 
    5737=cut 
  • Apache-ACEProxy/trunk/t/00_aceproxy.t

    r217 r247  
    44 
    55use Apache::ACEProxy; 
     6use Apache::ACEProxy::UTF8_RACE; 
    67ok(1); 
    78