mod_charset_lite.xml revision a44a46d07b191ccbc246e4debdaf4018dbfecc85
3931010d4e211e93afe24111906bfe7065fc9c6dChristian Clausen<?xml version="1.0"?>
d27bf65fca64c4f86177742c215f0705017aad47Christian Clausen<!DOCTYPE modulesynopsis SYSTEM "/style/modulesynopsis.dtd">
3931010d4e211e93afe24111906bfe7065fc9c6dChristian Clausen<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
3931010d4e211e93afe24111906bfe7065fc9c6dChristian Clausen<!-- $LastChangedRevision$ -->
3931010d4e211e93afe24111906bfe7065fc9c6dChristian Clausen
3931010d4e211e93afe24111906bfe7065fc9c6dChristian Clausen<!--
3931010d4e211e93afe24111906bfe7065fc9c6dChristian Clausen Licensed to the Apache Software Foundation (ASF) under one or more
3931010d4e211e93afe24111906bfe7065fc9c6dChristian Clausen contributor license agreements. See the NOTICE file distributed with
3931010d4e211e93afe24111906bfe7065fc9c6dChristian Clausen this work for additional information regarding copyright ownership.
3931010d4e211e93afe24111906bfe7065fc9c6dChristian Clausen The ASF licenses this file to You under the Apache License, Version 2.0
634abf6594d5960c4ca0b0701b69a81231b05aceChristian Clausen (the "License"); you may not use this file except in compliance with
3931010d4e211e93afe24111906bfe7065fc9c6dChristian Clausen the License. You may obtain a copy of the License at
3931010d4e211e93afe24111906bfe7065fc9c6dChristian Clausen
3931010d4e211e93afe24111906bfe7065fc9c6dChristian Clausen http://www.apache.org/licenses/LICENSE-2.0
3931010d4e211e93afe24111906bfe7065fc9c6dChristian Clausen
3931010d4e211e93afe24111906bfe7065fc9c6dChristian Clausen Unless required by applicable law or agreed to in writing, software
3931010d4e211e93afe24111906bfe7065fc9c6dChristian Clausen distributed under the License is distributed on an "AS IS" BASIS,
3931010d4e211e93afe24111906bfe7065fc9c6dChristian Clausen WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3931010d4e211e93afe24111906bfe7065fc9c6dChristian Clausen See the License for the specific language governing permissions and
3931010d4e211e93afe24111906bfe7065fc9c6dChristian Clausen limitations under the License.
3931010d4e211e93afe24111906bfe7065fc9c6dChristian Clausen-->
d27bf65fca64c4f86177742c215f0705017aad47Christian Clausen
3931010d4e211e93afe24111906bfe7065fc9c6dChristian Clausen<modulesynopsis metafile="mod_charset_lite.xml.meta">
3931010d4e211e93afe24111906bfe7065fc9c6dChristian Clausen
69c8a4f1ecebd95f47261dd8ade4c7684d6d82a5Christian Clausen<name>mod_charset_lite</name>
69c8a4f1ecebd95f47261dd8ade4c7684d6d82a5Christian Clausen<description>Specify character set translation or recoding</description>
69c8a4f1ecebd95f47261dd8ade4c7684d6d82a5Christian Clausen<status>Extension</status>
69c8a4f1ecebd95f47261dd8ade4c7684d6d82a5Christian Clausen<sourcefile>mod_charset_lite.c</sourcefile>
0ae77dd0f6698fa1948d1c6c973cc64d6df9e8d6Christian Clausen<identifier>charset_lite_module</identifier>
0ae77dd0f6698fa1948d1c6c973cc64d6df9e8d6Christian Clausen
69c8a4f1ecebd95f47261dd8ade4c7684d6d82a5Christian Clausen<summary>
69c8a4f1ecebd95f47261dd8ade4c7684d6d82a5Christian Clausen <p><module>mod_charset_lite</module> allows the administrator to
69c8a4f1ecebd95f47261dd8ade4c7684d6d82a5Christian Clausen specify the source character set of objects as well as the
5c1d8aff3d462ead6cae19e84c3c77ea968c0d69Christian Clausen character set they should be translated into before sending to the
64533bb0160210256e0a393ea102a4c4f1cc8ecaChristian Clausen client. <module>mod_charset_lite</module> does not translate the
64533bb0160210256e0a393ea102a4c4f1cc8ecaChristian Clausen data itself but instead tells Apache what translation to
64533bb0160210256e0a393ea102a4c4f1cc8ecaChristian Clausen perform. <module>mod_charset_lite</module> is applicable to EBCDIC
64533bb0160210256e0a393ea102a4c4f1cc8ecaChristian Clausen and ASCII host environments. In an EBCDIC environment, Apache
64533bb0160210256e0a393ea102a4c4f1cc8ecaChristian Clausen normally translates text content from the code page of the Apache
a0b65fd7d17589196751bea546f738c3534c4facChristian Clausen process locale to ISO-8859-1. <module>mod_charset_lite</module>
3931010d4e211e93afe24111906bfe7065fc9c6dChristian Clausen can be used to specify that a different translation is to be
performed. In an ASCII environment, Apache normally performs no
translation, so <module>mod_charset_lite</module> is needed in
order for any translation to take place.</p>
<p>This module provides a small subset of configuration
mechanisms implemented by Russian Apache and its associated
<code>mod_charset</code>.</p>
</summary>
<section id="problems"><title>Common Problems</title>
<section><title>Invalid character set names</title>
<p>The character set name parameters of <directive
module="mod_charset_lite">CharsetSourceEnc</directive> and
<directive module="mod_charset_lite">CharsetDefault</directive>
must be acceptable to the translation mechanism used by
<glossary>APR</glossary> on the system where
<module>mod_charset_lite</module> is deployed. These character
set names are not standardized and are usually not the same as
the corresponding values used in http headers. Currently, APR
can only use iconv(3), so you can easily test your character set
names using the iconv(1) program, as follows:</p>
<example>
iconv -f charsetsourceenc-value -t charsetdefault-value
</example>
</section>
<section><title>Mismatch between character set of content and translation
rules</title>
<p>If the translation rules don't make sense for the content,
translation can fail in various ways, including:</p>
<ul>
<li>The translation mechanism may return a bad return code,
and the connection will be aborted.</li>
<li>The translation mechanism may silently place special
characters (e.g., question marks) in the output buffer when
it cannot translate the input buffer.</li>
</ul>
</section>
</section>
<directivesynopsis>
<name>CharsetSourceEnc</name>
<description>Source charset of files</description>
<syntax>CharsetSourceEnc <var>charset</var></syntax>
<contextlist><context>server config</context>
<context>virtual host</context><context>directory</context>
<context>.htaccess</context>
</contextlist>
<override>FileInfo</override>
<usage>
<p>The <directive>CharsetSourceEnc</directive> directive specifies the
source charset of files in the associated container.</p>
<p>The value of the <var>charset</var> argument must be accepted
as a valid character set name by the character set support in
<glossary>APR</glossary>. Generally, this means that it must be
supported by iconv.</p>
<example><title>Example</title>
&lt;Directory /export/home/trawick/apacheinst/htdocs/convert&gt;<br />
<indent>
CharsetSourceEnc UTF-16BE<br />
CharsetDefault ISO-8859-1<br />
</indent>
&lt;/Directory&gt;
</example>
<p>The character set names in this example work with the iconv
translation support in Solaris 8.</p>
</usage>
</directivesynopsis>
<directivesynopsis>
<name>CharsetDefault</name>
<description>Charset to translate into</description>
<syntax>CharsetDefault <var>charset</var></syntax>
<contextlist><context>server config</context>
<context>virtual host</context><context>directory</context>
<context>.htaccess</context>
</contextlist>
<override>FileInfo</override>
<usage>
<p>The <directive>CharsetDefault</directive> directive specifies the
charset that content in the associated container should be
translated to.</p>
<p>The value of the <var>charset</var> argument must be accepted
as a valid character set name by the character set support in
<glossary>APR</glossary>. Generally, this means that it must be
supported by iconv.</p>
<example><title>Example</title>
&lt;Directory /export/home/trawick/apacheinst/htdocs/convert&gt;<br />
<indent>
CharsetSourceEnc UTF-16BE<br />
CharsetDefault ISO-8859-1<br />
</indent>
&lt;/Directory&gt;
</example>
</usage>
</directivesynopsis>
<directivesynopsis>
<name>CharsetOptions</name>
<description>Configures charset translation behavior</description>
<syntax>CharsetOptions <var>option</var> [<var>option</var>] ...</syntax>
<default>CharsetOptions DebugLevel=0 NoImplicitAdd</default>
<contextlist><context>server config</context>
<context>virtual host</context><context>directory</context>
<context>.htaccess</context>
</contextlist>
<override>FileInfo</override>
<usage>
<p>The <directive>CharsetOptions</directive> directive configures certain
behaviors of <module>mod_charset_lite</module>. <var>Option</var> can
be one of</p>
<dl>
<dt><code>DebugLevel=<var>n</var></code></dt>
<dd>The <code>DebugLevel</code> keyword allows you to specify
the level of debug messages generated by
<module>mod_charset_lite</module>. By default, no messages are
generated. This is equivalent to <code>DebugLevel=0</code>.
With higher numbers, more debug messages are generated, and
server performance will be degraded. The actual meanings of
the numeric values are described with the definitions of the
DBGLVL_ constants near the beginning of
<code>mod_charset_lite.c</code>.</dd>
<dt><code>ImplicitAdd | NoImplicitAdd</code></dt>
<dd>The <code>ImplicitAdd</code> keyword specifies that
<module>mod_charset_lite</module> should implicitly insert its
filter when the configuration specifies that the character
set of content should be translated. If the filter chain is
explicitly configured using the <directive module="mod_mime"
>AddOutputFilter</directive> directive, <code>NoImplicitAdd</code>
should be specified so that <module>mod_charset_lite</module>
doesn't add its filter.</dd>
<dt><code>TranslateAllMimeTypes | NoTranslateAllMimeTypes</code></dt>
<dd>Normally, <module>mod_charset_lite</module> will only perform
translation on a small subset of possible mimetypes. When the
<code>TranslateAllMimeTypes</code> keyword is specified for a given
configuration section, translation is performed without regard for
mimetype.</dd>
</dl>
</usage>
</directivesynopsis>
</modulesynopsis>