]> granicus.if.org Git - apache/blob - docs/manual/mod/mod_charset_lite.html.en
Update docco xforms
[apache] / docs / manual / mod / mod_charset_lite.html.en
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
4         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
5               This file is generated from xml source: DO NOT EDIT
6         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
7       -->
8 <title>mod_charset_lite - Apache HTTP Server</title>
9 <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
10 <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
11 <link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" />
12 <link href="../images/favicon.ico" rel="shortcut icon" /></head>
13 <body>
14 <div id="page-header">
15 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p>
16 <p class="apache">Apache HTTP Server Version 2.3</p>
17 <img alt="" src="../images/feather.gif" /></div>
18 <div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="../images/left.gif" /></a></div>
19 <div id="path">
20 <a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.3</a> &gt; <a href="./">Modules</a></div>
21 <div id="page-content">
22 <div id="preamble"><h1>Apache Module mod_charset_lite</h1>
23 <div class="toplang">
24 <p><span>Available Languages: </span><a href="../en/mod/mod_charset_lite.html" title="English">&nbsp;en&nbsp;</a> |
25 <a href="../ko/mod/mod_charset_lite.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a></p>
26 </div>
27 <table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Specify character set translation or recoding</td></tr>
28 <tr><th><a href="module-dict.html#Status">Status:</a></th><td>Extension</td></tr>
29 <tr><th><a href="module-dict.html#ModuleIdentifier">Module Identifier:</a></th><td>charset_lite_module</td></tr>
30 <tr><th><a href="module-dict.html#SourceFile">Source File:</a></th><td>mod_charset_lite.c</td></tr></table>
31 <h3>Summary</h3>
32
33     <p><code class="module"><a href="../mod/mod_charset_lite.html">mod_charset_lite</a></code> allows the server to change
34     the character set of responses before sending them to the client.
35     In an EBCDIC environment, Apache always translates HTTP protocol
36     content (e.g. response headers) from the code page of the Apache
37     process locale to ISO-8859-1, but not the body of responses.  In
38     any environment, <code class="module"><a href="../mod/mod_charset_lite.html">mod_charset_lite</a></code> can be used to
39     specify that response bodies should be translated.  For example,
40     if files are stored in EBCDIC, then 
41     <code class="module"><a href="../mod/mod_charset_lite.html">mod_charset_lite</a></code> can translate them to
42     ISO-8859-1 before sending them to the client.</p>
43
44     <p>This module provides a small subset of configuration
45     mechanisms implemented by Russian Apache and its associated
46     <code>mod_charset</code>.</p>
47 </div>
48 <div id="quickview"><h3 class="directives">Directives</h3>
49 <ul id="toc">
50 <li><img alt="" src="../images/down.gif" /> <a href="#charsetdefault">CharsetDefault</a></li>
51 <li><img alt="" src="../images/down.gif" /> <a href="#charsetoptions">CharsetOptions</a></li>
52 <li><img alt="" src="../images/down.gif" /> <a href="#charsetsourceenc">CharsetSourceEnc</a></li>
53 </ul>
54 <h3>Topics</h3>
55 <ul id="topics">
56 <li><img alt="" src="../images/down.gif" /> <a href="#problems">Common Problems</a></li>
57 </ul></div>
58 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
59 <div class="section">
60 <h2><a name="problems" id="problems">Common Problems</a></h2>
61
62     <h3>Invalid character set names</h3>
63
64       <p>The character set name parameters of <code class="directive"><a href="#charsetsourceenc">CharsetSourceEnc</a></code> and
65       <code class="directive"><a href="#charsetdefault">CharsetDefault</a></code>
66       must be acceptable to the translation mechanism used by
67       <a class="glossarylink" href="../glossary.html#apr" title="see glossary">APR</a> on the system where
68       <code class="module"><a href="../mod/mod_charset_lite.html">mod_charset_lite</a></code> is deployed.  These character
69       set names are not standardized and are usually not the same as
70       the corresponding values used in http headers.  Currently, APR
71       can only use iconv(3), so you can easily test your character set
72       names using the iconv(1) program, as follows:</p>
73
74       <div class="example"><p><code>
75         iconv -f charsetsourceenc-value -t charsetdefault-value
76       </code></p></div>
77     
78
79     <h3>Mismatch between character set of content and translation
80     rules</h3>
81
82       <p>If the translation rules don't make sense for the content,
83       translation can fail in various ways, including:</p>
84
85       <ul>
86       <li>The translation mechanism may return a bad return code,
87       and the connection will be aborted.</li>
88
89       <li>The translation mechanism may silently place special
90       characters (e.g., question marks) in the output buffer when
91       it cannot translate the input buffer.</li>
92       </ul>
93     
94 </div>
95 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
96 <div class="directive-section"><h2><a name="CharsetDefault" id="CharsetDefault">CharsetDefault</a> <a name="charsetdefault" id="charsetdefault">Directive</a></h2>
97 <table class="directive">
98 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Charset to translate into</td></tr>
99 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>CharsetDefault <var>charset</var></code></td></tr>
100 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
101 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
102 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
103 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_charset_lite</td></tr>
104 </table>
105     <p>The <code class="directive">CharsetDefault</code> directive specifies the
106     charset that content in the associated container should be
107     translated to.</p>
108
109     <p>The value of the <var>charset</var> argument must be accepted
110     as a valid character set name by the character set support in
111     <a class="glossarylink" href="../glossary.html#apr" title="see glossary">APR</a>. Generally, this means that it must be
112     supported by iconv.</p>
113
114     <div class="example"><h3>Example</h3><p><code>
115       &lt;Directory /export/home/trawick/apacheinst/htdocs/convert&gt;<br />
116       <span class="indent">
117         CharsetSourceEnc  UTF-16BE<br />
118         CharsetDefault    ISO-8859-1<br />
119       </span>
120       &lt;/Directory&gt;
121     </code></p></div>
122
123      <div class="note">
124      Specifying the same charset for both <code class="directive"><a href="#charsetsourceenc">CharsetSourceEnc</a></code>
125      and <code class="directive"><a href="#charsetdefault">CharsetDefault</a></code> disables translation. The charset
126      need not match the charset of the response, but it must be a valid charset on the system.
127      </div>
128
129
130 </div>
131 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
132 <div class="directive-section"><h2><a name="CharsetOptions" id="CharsetOptions">CharsetOptions</a> <a name="charsetoptions" id="charsetoptions">Directive</a></h2>
133 <table class="directive">
134 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Configures charset translation behavior</td></tr>
135 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>CharsetOptions <var>option</var> [<var>option</var>] ...</code></td></tr>
136 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>CharsetOptions ImplicitAdd</code></td></tr>
137 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
138 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
139 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
140 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_charset_lite</td></tr>
141 </table>
142     <p>The <code class="directive">CharsetOptions</code> directive configures certain
143     behaviors of <code class="module"><a href="../mod/mod_charset_lite.html">mod_charset_lite</a></code>. <var>Option</var> can
144     be one of</p>
145
146     <dl>
147       <dt><code>ImplicitAdd | NoImplicitAdd</code></dt>
148
149       <dd>The <code>ImplicitAdd</code> keyword specifies that
150       <code class="module"><a href="../mod/mod_charset_lite.html">mod_charset_lite</a></code> should implicitly insert its
151       filter when the configuration specifies that the character
152       set of content should be translated. If the filter chain is
153       explicitly configured using the <code class="directive"><a href="../mod/mod_mime.html#addoutputfilter">AddOutputFilter</a></code> directive, <code>NoImplicitAdd</code>
154       should be specified so that <code class="module"><a href="../mod/mod_charset_lite.html">mod_charset_lite</a></code>
155       doesn't add its filter.</dd>
156
157       <dt><code>TranslateAllMimeTypes | NoTranslateAllMimeTypes</code></dt>
158       <dd>Normally, <code class="module"><a href="../mod/mod_charset_lite.html">mod_charset_lite</a></code> will only perform
159       translation on a small subset of possible mimetypes.  When the
160       <code>TranslateAllMimeTypes</code> keyword is specified for a given
161       configuration section, translation is performed without regard for
162       mimetype.</dd>
163
164     </dl>
165
166 </div>
167 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
168 <div class="directive-section"><h2><a name="CharsetSourceEnc" id="CharsetSourceEnc">CharsetSourceEnc</a> <a name="charsetsourceenc" id="charsetsourceenc">Directive</a></h2>
169 <table class="directive">
170 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Source charset of files</td></tr>
171 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>CharsetSourceEnc <var>charset</var></code></td></tr>
172 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
173 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
174 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
175 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_charset_lite</td></tr>
176 </table>
177     <p>The <code class="directive">CharsetSourceEnc</code> directive specifies the
178     source charset of files in the associated container.</p>
179
180     <p>The value of the <var>charset</var> argument must be accepted
181     as a valid character set name by the character set support in
182     <a class="glossarylink" href="../glossary.html#apr" title="see glossary">APR</a>. Generally, this means that it must be
183     supported by iconv.</p>
184     
185     <div class="example"><h3>Example</h3><p><code>
186       &lt;Directory /export/home/trawick/apacheinst/htdocs/convert&gt;<br />
187       <span class="indent">
188         CharsetSourceEnc  UTF-16BE<br />
189         CharsetDefault    ISO-8859-1<br />
190       </span>
191       &lt;/Directory&gt;
192     </code></p></div>
193
194     <p>The character set names in this example work with the iconv
195     translation support in Solaris 8.</p>
196  
197      <div class="note">
198      Specifying the same charset for both <code class="directive"><a href="#charsetsourceenc">CharsetSourceEnc</a></code>
199      and <code class="directive"><a href="#charsetdefault">CharsetDefault</a></code> disables translation. The charset
200      need not match the charset of the response, but it must be a valid charset on the system.
201      </div>
202
203
204 </div>
205 </div>
206 <div class="bottomlang">
207 <p><span>Available Languages: </span><a href="../en/mod/mod_charset_lite.html" title="English">&nbsp;en&nbsp;</a> |
208 <a href="../ko/mod/mod_charset_lite.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a></p>
209 </div><div id="footer">
210 <p class="apache">Copyright 2011 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
211 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div>
212 </body></html>