root/Apache-DefaultCharset/trunk/README

Revision 744 (checked in by miyagawa, 18 years ago)

0.02

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 NAME
2     Apache::DefaultCharset - AddDefaultCharset configuration from mod_perl
3
4 SYNOPSIS
5       use Apache::DefaultCharset;
6
7       # This module adds "add_default_charset_name" method
8       $charset = $r->add_default_charset_name;
9       $r->add_default_charset_name('euc-jp');
10
11       # via Apache::DefaultCharset object
12       $charset = Apache::DefaultCharset->new($r);
13       print "default_charset_name is ", $charset->name;
14       # or print "default charset is $charset"; will do (overload)
15       $charset->name('euc-jp');
16
17 DESCRIPTION
18     Apache::DefaultCharset is an XS wrapper for Apache Core's
19     "AddDefaultCharset" configuration.
20
21 EXAMPLES
22   Unicode Handling
23
24     Suppose you develop multi-language web application, and transparently
25     decode native encodings into Unicode string inside Perl (5.8 or over
26     would be better). First you should add
27
28       AddDefaultCharset euc-jp
29
30     in your "httpd.conf", then leave off "send_http_header" arguments just
31     to text/html. Then you can get the current configuration with this
32     module when you use "Encode" or "Text::Iconv" to decode the HTTP request
33     query into Unicode.
34
35   Modification of DefaultCharset
36
37     Suppose you want to add utf-8 for XML files, and Shift_JIS for HTML
38     files as HTTP charset attribute by default ("By default" means that if
39     you set "content_type" explicitly in content-generation phase, that will
40     be prior to the defalut). This module enables you to write
41     "PerlFixupHandler" to configure "add_default_charset_name" in run-time.
42
43 AUTHOR
44     Tatsuhiko Miyagawa <miyagawa@bulknews.net>
45
46     This library is free software; you can redistribute it and/or modify it
47     under the same terms as Perl itself.
48
49 SEE ALSO
50     the Apache::DefaultCharset manpage
51
52     mod_perl cookbook at http://www.modperlcookbook.org/
53
Note: See TracBrowser for help on using the browser.