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
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>
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="<-" alt="<-" src="../images/left.gif" /></a></div>
20 <a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP Server</a> > <a href="http://httpd.apache.org/docs/">Documentation</a> > <a href="../">Version 2.3</a> > <a href="./">Modules</a></div>
21 <div id="page-content">
22 <div id="preamble"><h1>Apache Module mod_charset_lite</h1>
24 <p><span>Available Languages: </span><a href="../en/mod/mod_charset_lite.html" title="English"> en </a> |
25 <a href="../ko/mod/mod_charset_lite.html" hreflang="ko" rel="alternate" title="Korean"> ko </a></p>
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>
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>
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>
48 <div id="quickview"><h3 class="directives">Directives</h3>
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>
56 <li><img alt="" src="../images/down.gif" /> <a href="#problems">Common Problems</a></li>
58 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
60 <h2><a name="problems" id="problems">Common Problems</a></h2>
62 <h3>Invalid character set names</h3>
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>
74 <div class="example"><p><code>
75 iconv -f charsetsourceenc-value -t charsetdefault-value
79 <h3>Mismatch between character set of content and translation
82 <p>If the translation rules don't make sense for the content,
83 translation can fail in various ways, including:</p>
86 <li>The translation mechanism may return a bad return code,
87 and the connection will be aborted.</li>
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>
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>
105 <p>The <code class="directive">CharsetDefault</code> directive specifies the
106 charset that content in the associated container should be
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>
114 <div class="example"><h3>Example</h3><p><code>
115 <Directory /export/home/trawick/apacheinst/htdocs/convert><br />
116 <span class="indent">
117 CharsetSourceEnc UTF-16BE<br />
118 CharsetDefault ISO-8859-1<br />
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.
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>
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
147 <dt><code>ImplicitAdd | NoImplicitAdd</code></dt>
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>
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
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>
177 <p>The <code class="directive">CharsetSourceEnc</code> directive specifies the
178 source charset of files in the associated container.</p>
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>
185 <div class="example"><h3>Example</h3><p><code>
186 <Directory /export/home/trawick/apacheinst/htdocs/convert><br />
187 <span class="indent">
188 CharsetSourceEnc UTF-16BE<br />
189 CharsetDefault ISO-8859-1<br />
194 <p>The character set names in this example work with the iconv
195 translation support in Solaris 8.</p>
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.
206 <div class="bottomlang">
207 <p><span>Available Languages: </span><a href="../en/mod/mod_charset_lite.html" title="English"> en </a> |
208 <a href="../ko/mod/mod_charset_lite.html" hreflang="ko" rel="alternate" title="Korean"> ko </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>