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.2</p> 20<img alt="" src="/images/feather.gif" /></div> 21<div class="up"><a href="./"><img title="<-" alt="<-" src="/images/left.gif" /></a></div> 22<div id="path"> 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.2</a> > <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"> en </a> | 28<a href="/ko/mod/mod_charset_lite.html" hreflang="ko" rel="alternate" title="Korean"> ko </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><p><code> 118 <Directory /export/home/trawick/apacheinst/htdocs/convert><br /> 119 <span class="indent"> 120 CharsetSourceEnc UTF-16BE<br /> 121 CharsetDefault ISO-8859-1<br /> 122 </span> 123 </Directory> 124 </code></p></div> 125 126</div> 127<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 128<div class="directive-section"><h2><a name="CharsetOptions" id="CharsetOptions">CharsetOptions</a> <a name="charsetoptions" id="charsetoptions">Directive</a></h2> 129<table class="directive"> 130<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Configures charset translation behavior</td></tr> 131<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>CharsetOptions <var>option</var> [<var>option</var>] ...</code></td></tr> 132<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>CharsetOptions DebugLevel=0 NoImplicitAdd</code></td></tr> 133<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr> 134<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr> 135<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr> 136<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_charset_lite</td></tr> 137</table> 138 <p>The <code class="directive">CharsetOptions</code> directive configures certain 139 behaviors of <code class="module"><a href="/mod/mod_charset_lite.html">mod_charset_lite</a></code>. <var>Option</var> can 140 be one of</p> 141 142 <dl> 143 <dt><code>DebugLevel=<var>n</var></code></dt> 144 145 <dd>The <code>DebugLevel</code> keyword allows you to specify 146 the level of debug messages generated by 147 <code class="module"><a href="/mod/mod_charset_lite.html">mod_charset_lite</a></code>. By default, no messages are 148 generated. This is equivalent to <code>DebugLevel=0</code>. 149 With higher numbers, more debug messages are generated, and 150 server performance will be degraded. The actual meanings of 151 the numeric values are described with the definitions of the 152 DBGLVL_ constants near the beginning of 153 <code>mod_charset_lite.c</code>.</dd> 154 155 <dt><code>ImplicitAdd | NoImplicitAdd</code></dt> 156 157 <dd>The <code>ImplicitAdd</code> keyword specifies that 158 <code class="module"><a href="/mod/mod_charset_lite.html">mod_charset_lite</a></code> should implicitly insert its 159 filter when the configuration specifies that the character 160 set of content should be translated. If the filter chain is 161 explicitly configured using the <code class="directive"><a href="/mod/mod_mime.html#addoutputfilter">AddOutputFilter</a></code> directive, <code>NoImplicitAdd</code> 162 should be specified so that <code class="module"><a href="/mod/mod_charset_lite.html">mod_charset_lite</a></code> 163 doesn't add its filter.</dd> 164 165 <dt><code>TranslateAllMimeTypes | NoTranslateAllMimeTypes</code></dt> 166 <dd>Normally, <code class="module"><a href="/mod/mod_charset_lite.html">mod_charset_lite</a></code> will only perform 167 translation on a small subset of possible mimetypes. When the 168 <code>TranslateAllMimeTypes</code> keyword is specified for a given 169 configuration section, translation is performed without regard for 170 mimetype.</dd> 171 172 </dl> 173 174</div> 175<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 176<div class="directive-section"><h2><a name="CharsetSourceEnc" id="CharsetSourceEnc">CharsetSourceEnc</a> <a name="charsetsourceenc" id="charsetsourceenc">Directive</a></h2> 177<table class="directive"> 178<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Source charset of files</td></tr> 179<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>CharsetSourceEnc <var>charset</var></code></td></tr> 180<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr> 181<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr> 182<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr> 183<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_charset_lite</td></tr> 184</table> 185 <p>The <code class="directive">CharsetSourceEnc</code> directive specifies the 186 source charset of files in the associated container.</p> 187 188 <p>The value of the <var>charset</var> argument must be accepted 189 as a valid character set name by the character set support in 190 <a class="glossarylink" href="/glossary.html#apr" title="see glossary">APR</a>. Generally, this means that it must be 191 supported by iconv.</p> 192 193 <div class="example"><h3>Example</h3><p><code> 194 <Directory /export/home/trawick/apacheinst/htdocs/convert><br /> 195 <span class="indent"> 196 CharsetSourceEnc UTF-16BE<br /> 197 CharsetDefault ISO-8859-1<br /> 198 </span> 199 </Directory> 200 </code></p></div> 201 202 <p>The character set names in this example work with the iconv 203 translation support in Solaris 8.</p> 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"> 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[//><!-- 212var comments_shortname = 'httpd'; 213var comments_identifier = 'http://httpd.apache.org/docs/2.2/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 2013 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[//><!-- 230if (typeof(prettyPrint) !== 'undefined') { 231 prettyPrint(); 232} 233//--><!]]></script> 234</body></html>