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" /><link rel="stylesheet" type="text/css" href="../style/css/prettify.css" />
12 <script src="../style/scripts/prettify.js" type="text/javascript">
15 <link href="../images/favicon.ico" rel="shortcut icon" /></head>
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="<-" alt="<-" src="../images/left.gif" /></a></div>
23 <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.4</a> > <a href="./">Modules</a></div>
24 <div id="page-content">
25 <div id="preamble"><h1>Apache Module mod_charset_lite</h1>
27 <p><span>Available Languages: </span><a href="../en/mod/mod_charset_lite.html" title="English"> en </a> |
28 <a href="../ko/mod/mod_charset_lite.html" hreflang="ko" rel="alternate" title="Korean"> ko </a></p>
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>
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>
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>
51 <div id="quickview"><h3 class="directives">Directives</h3>
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>
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>
63 <h2><a name="problems" id="problems">Common Problems</a></h2>
65 <h3>Invalid character set names</h3>
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>
77 <div class="example"><p><code>
78 iconv -f charsetsourceenc-value -t charsetdefault-value
82 <h3>Mismatch between character set of content and translation
85 <p>If the translation rules don't make sense for the content,
86 translation can fail in various ways, including:</p>
89 <li>The translation mechanism may return a bad return code,
90 and the connection will be aborted.</li>
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>
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>
108 <p>The <code class="directive">CharsetDefault</code> directive specifies the
109 charset that content in the associated container should be
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>
117 <div class="example"><h3>Example</h3><pre class="prettyprint lang-config">
118 <Directory /export/home/trawick/apacheinst/htdocs/convert>
119 CharsetSourceEnc UTF-16BE
120 CharsetDefault ISO-8859-1
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.
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>
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
149 <dt><code>ImplicitAdd | NoImplicitAdd</code></dt>
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>
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
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>
179 <p>The <code class="directive">CharsetSourceEnc</code> directive specifies the
180 source charset of files in the associated container.</p>
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>
187 <div class="example"><h3>Example</h3><pre class="prettyprint lang-config">
188 <Directory /export/home/trawick/apacheinst/htdocs/convert>
189 CharsetSourceEnc UTF-16BE
190 CharsetDefault ISO-8859-1
195 <p>The character set names in this example work with the iconv
196 translation support in Solaris 8.</p>
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.
207 <div class="bottomlang">
208 <p><span>Available Languages: </span><a href="../en/mod/mod_charset_lite.html" title="English"> en </a> |
209 <a href="../ko/mod/mod_charset_lite.html" hreflang="ko" rel="alternate" title="Korean"> ko </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&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';
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';
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);
224 d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>');
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') {