]> granicus.if.org Git - apache/blob - docs/manual/mod/mod_charset_lite.html.en
rebuild mod pages.
[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" /><link rel="stylesheet" type="text/css" href="../style/css/prettify.css" />
12 <script src="../style/scripts/prettify.js" type="text/javascript">
13 </script>
14
15 <link href="../images/favicon.ico" rel="shortcut icon" /></head>
16 <body>
17 <div id="page-header">
18 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p>
19 <p class="apache">Apache HTTP Server Version 2.4</p>
20 <img alt="" src="../images/feather.gif" /></div>
21 <div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="../images/left.gif" /></a></div>
22 <div id="path">
23 <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.4</a> &gt; <a href="./">Modules</a></div>
24 <div id="page-content">
25 <div id="preamble"><h1>Apache Module mod_charset_lite</h1>
26 <div class="toplang">
27 <p><span>Available Languages: </span><a href="../en/mod/mod_charset_lite.html" title="English">&nbsp;en&nbsp;</a> |
28 <a href="../ko/mod/mod_charset_lite.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a></p>
29 </div>
30 <table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Specify character set translation or recoding</td></tr>
31 <tr><th><a href="module-dict.html#Status">Status:</a></th><td>Extension</td></tr>
32 <tr><th><a href="module-dict.html#ModuleIdentifier">Module Identifier:</a></th><td>charset_lite_module</td></tr>
33 <tr><th><a href="module-dict.html#SourceFile">Source File:</a></th><td>mod_charset_lite.c</td></tr></table>
34 <h3>Summary</h3>
35
36     <p><code class="module"><a href="../mod/mod_charset_lite.html">mod_charset_lite</a></code> allows the server to change
37     the character set of responses before sending them to the client.
38     In an EBCDIC environment, Apache always translates HTTP protocol
39     content (e.g. response headers) from the code page of the Apache
40     process locale to ISO-8859-1, but not the body of responses.  In
41     any environment, <code class="module"><a href="../mod/mod_charset_lite.html">mod_charset_lite</a></code> can be used to
42     specify that response bodies should be translated.  For example,
43     if files are stored in EBCDIC, then
44     <code class="module"><a href="../mod/mod_charset_lite.html">mod_charset_lite</a></code> can translate them to
45     ISO-8859-1 before sending them to the client.</p>
46
47     <p>This module provides a small subset of configuration
48     mechanisms implemented by Russian Apache and its associated
49     <code>mod_charset</code>.</p>
50 </div>
51 <div id="quickview"><h3 class="directives">Directives</h3>
52 <ul id="toc">
53 <li><img alt="" src="../images/down.gif" /> <a href="#charsetdefault">CharsetDefault</a></li>
54 <li><img alt="" src="../images/down.gif" /> <a href="#charsetoptions">CharsetOptions</a></li>
55 <li><img alt="" src="../images/down.gif" /> <a href="#charsetsourceenc">CharsetSourceEnc</a></li>
56 </ul>
57 <h3>Topics</h3>
58 <ul id="topics">
59 <li><img alt="" src="../images/down.gif" /> <a href="#problems">Common Problems</a></li>
60 </ul><ul class="seealso"><li><a href="#comments_section">Comments</a></li></ul></div>
61 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
62 <div class="section">
63 <h2><a name="problems" id="problems">Common Problems</a></h2>
64
65     <h3>Invalid character set names</h3>
66
67       <p>The character set name parameters of <code class="directive"><a href="#charsetsourceenc">CharsetSourceEnc</a></code> and
68       <code class="directive"><a href="#charsetdefault">CharsetDefault</a></code>
69       must be acceptable to the translation mechanism used by
70       <a class="glossarylink" href="../glossary.html#apr" title="see glossary">APR</a> on the system where
71       <code class="module"><a href="../mod/mod_charset_lite.html">mod_charset_lite</a></code> is deployed.  These character
72       set names are not standardized and are usually not the same as
73       the corresponding values used in http headers.  Currently, APR
74       can only use iconv(3), so you can easily test your character set
75       names using the iconv(1) program, as follows:</p>
76
77       <div class="example"><p><code>
78         iconv -f charsetsourceenc-value -t charsetdefault-value
79       </code></p></div>
80     
81
82     <h3>Mismatch between character set of content and translation
83     rules</h3>
84
85       <p>If the translation rules don't make sense for the content,
86       translation can fail in various ways, including:</p>
87
88       <ul>
89       <li>The translation mechanism may return a bad return code,
90       and the connection will be aborted.</li>
91
92       <li>The translation mechanism may silently place special
93       characters (e.g., question marks) in the output buffer when
94       it cannot translate the input buffer.</li>
95       </ul>
96     
97 </div>
98 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
99 <div class="directive-section"><h2><a name="CharsetDefault" id="CharsetDefault">CharsetDefault</a> <a name="charsetdefault" id="charsetdefault">Directive</a></h2>
100 <table class="directive">
101 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Charset to translate into</td></tr>
102 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>CharsetDefault <var>charset</var></code></td></tr>
103 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
104 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
105 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
106 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_charset_lite</td></tr>
107 </table>
108     <p>The <code class="directive">CharsetDefault</code> directive specifies the
109     charset that content in the associated container should be
110     translated to.</p>
111
112     <p>The value of the <var>charset</var> argument must be accepted
113     as a valid character set name by the character set support in
114     <a class="glossarylink" href="../glossary.html#apr" title="see glossary">APR</a>. Generally, this means that it must be
115     supported by iconv.</p>
116
117     <div class="example"><h3>Example</h3><pre class="prettyprint lang-config">
118 &lt;Directory /export/home/trawick/apacheinst/htdocs/convert&gt;
119     CharsetSourceEnc  UTF-16BE
120     CharsetDefault    ISO-8859-1
121 &lt;/Directory&gt;
122       </pre>
123 </div>
124
125      <div class="note">
126      Specifying the same charset for both <code class="directive"><a href="#charsetsourceenc">CharsetSourceEnc</a></code>
127      and <code class="directive"><a href="#charsetdefault">CharsetDefault</a></code> disables translation. The charset
128      need not match the charset of the response, but it must be a valid charset on the system.
129      </div>
130
131
132 </div>
133 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
134 <div class="directive-section"><h2><a name="CharsetOptions" id="CharsetOptions">CharsetOptions</a> <a name="charsetoptions" id="charsetoptions">Directive</a></h2>
135 <table class="directive">
136 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Configures charset translation behavior</td></tr>
137 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>CharsetOptions <var>option</var> [<var>option</var>] ...</code></td></tr>
138 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>CharsetOptions ImplicitAdd</code></td></tr>
139 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
140 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
141 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
142 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_charset_lite</td></tr>
143 </table>
144     <p>The <code class="directive">CharsetOptions</code> directive configures certain
145     behaviors of <code class="module"><a href="../mod/mod_charset_lite.html">mod_charset_lite</a></code>. <var>Option</var> can
146     be one of</p>
147
148     <dl>
149       <dt><code>ImplicitAdd | NoImplicitAdd</code></dt>
150
151       <dd>The <code>ImplicitAdd</code> keyword specifies that
152       <code class="module"><a href="../mod/mod_charset_lite.html">mod_charset_lite</a></code> should implicitly insert its
153       filter when the configuration specifies that the character
154       set of content should be translated. If the filter chain is
155       explicitly configured using the <code class="directive"><a href="../mod/mod_mime.html#addoutputfilter">AddOutputFilter</a></code> directive, <code>NoImplicitAdd</code>
156       should be specified so that <code class="module"><a href="../mod/mod_charset_lite.html">mod_charset_lite</a></code>
157       doesn't add its filter.</dd>
158
159       <dt><code>TranslateAllMimeTypes | NoTranslateAllMimeTypes</code></dt>
160       <dd>Normally, <code class="module"><a href="../mod/mod_charset_lite.html">mod_charset_lite</a></code> will only perform
161       translation on a small subset of possible mimetypes.  When the
162       <code>TranslateAllMimeTypes</code> keyword is specified for a given
163       configuration section, translation is performed without regard for
164       mimetype.</dd>
165
166     </dl>
167
168 </div>
169 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
170 <div class="directive-section"><h2><a name="CharsetSourceEnc" id="CharsetSourceEnc">CharsetSourceEnc</a> <a name="charsetsourceenc" id="charsetsourceenc">Directive</a></h2>
171 <table class="directive">
172 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Source charset of files</td></tr>
173 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>CharsetSourceEnc <var>charset</var></code></td></tr>
174 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
175 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
176 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
177 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_charset_lite</td></tr>
178 </table>
179     <p>The <code class="directive">CharsetSourceEnc</code> directive specifies the
180     source charset of files in the associated container.</p>
181
182     <p>The value of the <var>charset</var> argument must be accepted
183     as a valid character set name by the character set support in
184     <a class="glossarylink" href="../glossary.html#apr" title="see glossary">APR</a>. Generally, this means that it must be
185     supported by iconv.</p>
186
187     <div class="example"><h3>Example</h3><pre class="prettyprint lang-config">
188 &lt;Directory /export/home/trawick/apacheinst/htdocs/convert&gt;
189     CharsetSourceEnc  UTF-16BE
190     CharsetDefault    ISO-8859-1
191 &lt;/Directory&gt;
192       </pre>
193 </div>
194
195     <p>The character set names in this example work with the iconv
196     translation support in Solaris 8.</p>
197
198      <div class="note">
199      Specifying the same charset for both <code class="directive"><a href="#charsetsourceenc">CharsetSourceEnc</a></code>
200      and <code class="directive"><a href="#charsetdefault">CharsetDefault</a></code> disables translation. The charset
201      need not match the charset of the response, but it must be a valid charset on the system.
202      </div>
203
204
205 </div>
206 </div>
207 <div class="bottomlang">
208 <p><span>Available Languages: </span><a href="../en/mod/mod_charset_lite.html" title="English">&nbsp;en&nbsp;</a> |
209 <a href="../ko/mod/mod_charset_lite.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a></p>
210 </div><div class="top"><a href="#page-header"><img src="../images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Comments</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&amp;A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our <a href="http://httpd.apache.org/lists.html">mailing lists</a>.</div>
211 <script type="text/javascript"><!--//--><![CDATA[//><!--
212 var comments_shortname = 'httpd';
213 var comments_identifier = 'http://httpd.apache.org/docs/2.4/mod/mod_charset_lite.html';
214 (function(w, d) {
215     if (w.location.hostname.toLowerCase() == "httpd.apache.org") {
216         d.write('<div id="comments_thread"><\/div>');
217         var s = d.createElement('script');
218         s.type = 'text/javascript';
219         s.async = true;
220         s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier;
221         (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s);
222     }
223     else { 
224         d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>');
225     }
226 })(window, document);
227 //--><!]]></script></div><div id="footer">
228 <p class="apache">Copyright 2012 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>
229 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!--
230 if (typeof(prettyPrint) !== 'undefined') {
231     prettyPrint();
232 }
233 //--><!]]></script>
234 </body></html>