summaryrefslogtreecommitdiffstats
path: root/docs/manual/mod/mod_charset_lite.html
blob: a816db910688d8cdc60235d07b06999595ab2c05 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<html xmlns="http://www.w3.org/TR/xhtml1/strict"><head><!--
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
     This file is generated from xml source: DO NOT EDIT
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
--><title>mod_charset_lite - Apache HTTP Server</title><link href="../style/manual.css" type="text/css" rel="stylesheet"/></head><body><blockquote><div align="center"><img alt="[APACHE DOCUMENTATION]" src="../images/sub.gif"/><h3>Apache HTTP Server Version 2.0</h3></div><h1 align="center">Apache Module mod_charset_lite</h1><table cellspacing="1" cellpadding="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td valign="top"><span class="help">Description:</span></td><td><description>Specify character set translation or recoding</description></td></tr><tr><td><a href="module-dict.html#Status" class="help">Status:</a></td><td>Experimental</td></tr><tr><td><a href="module-dict.html#ModuleIdentifier" class="help">Module&nbsp;Identifier:</a></td><td>charset_lite_module</td></tr></table></td></tr></table><h2>Summary</h2><summary>
    <p>This is an <strong>experimental</strong> module and should
    be used with care. Experiment with your
    <code>mod_charset_lite</code> configuration to ensure that it
    performs the desired function.</p>

    <p><code><a href="mod_charset_lite.html">mod_charset_lite</a></code> allows the administrator to
    specify the source character set of objects as well as the
    character set they should be translated into before sending to the
    client. <code><a href="mod_charset_lite.html">mod_charset_lite</a></code> does not translate the
    data itself but instead tells Apache what translation to
    perform. <code><a href="mod_charset_lite.html">mod_charset_lite</a></code> is applicable to EBCDIC
    and ASCII host environments. In an EBCDIC environment, Apache
    normally translates text content from the code page of the Apache
    process locale to ISO-8859-1.  <code><a href="mod_charset_lite.html">mod_charset_lite</a></code>
    can be used to specify that a different translation is to be
    performed. In an ASCII environment, Apache normally performs no
    translation, so <code><a href="mod_charset_lite.html">mod_charset_lite</a></code> 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><h2>Directives</h2><ul><li><a href="#charsetdefault">CharsetDefault</a></li><li><a href="#charsetoptions">CharsetOptions</a></li><li><a href="#charsetsourceenc">CharsetSourceEnc</a></li></ul><h2>Common Problems</h2>

<h3>Invalid character set names</h3>

    <p>The character set name parameters of <a href="#charsetsourceenc" class="directive"><code class="directive">CharsetSourceEnc</code></a> and
    <a href="#charsetdefault" class="directive"><code class="directive">CharsetDefault</code></a>
    must be acceptable to the translation mechanism used by APR on the
    system where <code><a href="mod_charset_lite.html">mod_charset_lite</a></code> 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>
<blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>
  iconv -f charsetsourceenc-value -t charsetdefault-value
</code></td></tr></table></blockquote>


<h3>Mismatch between character set of content and translation
    rules</h3>

    <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>

<hr/><h2><a name="CharsetDefault">CharsetDefault</a> <a name="charsetdefault">Directive</a></h2><table cellpadding="1" cellspacing="0" border="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td><strong>Description: </strong></td><td>Charset to translate into</td></tr><tr><td><a href="directive-dict.html#Syntax" class="help">Syntax:</a></td><td><syntax>CharsetDefault <em>charset</em></syntax></td></tr><tr><td><a href="directive-dict.html#Context" class="help">Context:</a></td><td>server config, virtual host, directory, .htaccess</td></tr><tr><td><a href="directive-dict.html#Override" class="help">Override:</a></td><td>FileInfo</td></tr><tr><td><a href="directive-dict.html#Status" class="help">Status:</a></td><td>Experimental</td></tr><tr><td><a href="directive-dict.html#Module" class="help">Module:</a></td><td>mod_charset_lite</td></tr></table></td></tr></table><usage>
    <p>The <code class="directive">CharsetDefault</code> directive specifies the
    charset that content in the associated container should be
    translated to.</p>

    <p>The value of the <em>charset</em> argument must be accepted
    as a valid character set name by the character set support in
    APR. Generally, this means that it must be supported by
    iconv.</p>

<blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><p align="center"><strong>Example</strong></p><code>
    &lt;Directory "/export/home/trawick/apacheinst/htdocs/convert"&gt;<br>
    CharsetSourceEnc  UTF-16BE<br>
    CharsetDefault    ISO8859-1<br>
    &lt;/Directory&gt;
</code></td></tr></table></blockquote>
</usage><hr/><h2><a name="CharsetOptions">CharsetOptions</a> <a name="charsetoptions">Directive</a></h2><table cellpadding="1" cellspacing="0" border="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td><strong>Description: </strong></td><td>Configures charset tranlation behavior</td></tr><tr><td><a href="directive-dict.html#Syntax" class="help">Syntax:</a></td><td><syntax>CharsetOptions <em>option</em> [<em>option</em>] ...</syntax></td></tr><tr><td><a href="directive-dict.html#Default" class="help">Default:</a></td><td><code>CharsetOptions DebugLevel=0 
NoImplicitAdd</code></td></tr><tr><td><a href="directive-dict.html#Context" class="help">Context:</a></td><td>server config, virtual host, directory, .htaccess</td></tr><tr><td><a href="directive-dict.html#Override" class="help">Override:</a></td><td>FileInfo</td></tr><tr><td><a href="directive-dict.html#Status" class="help">Status:</a></td><td>Experimental</td></tr><tr><td><a href="directive-dict.html#Module" class="help">Module:</a></td><td>mod_charset_lite</td></tr></table></td></tr></table><usage>
    <p>The <code class="directive">CharsetOptions</code> directive configures certain
    behaviors of <code><a href="mod_charset_lite.html">mod_charset_lite</a></code>. <em>Option</em> can
    be one of</p>

    <dl>
      <dt>DebugLevel=<em>n</em></dt>

      <dd>The <code>DebugLevel</code> keyword allows you to specify
      the level of debug messages generated by
      <code><a href="mod_charset_lite.html">mod_charset_lite</a></code>. 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>ImplicitAdd | NoImplicitAdd</dt>

      <dd>The <code>ImplicitAdd</code> keyword specifies that
      <code><a href="mod_charset_lite.html">mod_charset_lite</a></code> 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 AddOutputFilter directive,
      <code>NoImplicitAdd</code> should be specified so that
      <code><a href="mod_charset_lite.html">mod_charset_lite</a></code> doesn't add its filter.</dd>
    </dl>
</usage><hr/><h2><a name="CharsetSourceEnc">CharsetSourceEnc</a> <a name="charsetsourceenc">Directive</a></h2><table cellpadding="1" cellspacing="0" border="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td><strong>Description: </strong></td><td>Source charset of files</td></tr><tr><td><a href="directive-dict.html#Syntax" class="help">Syntax:</a></td><td><syntax>CharsetSourceEnc <em>charset</em></syntax></td></tr><tr><td><a href="directive-dict.html#Context" class="help">Context:</a></td><td>server config, virtual host, directory, .htaccess</td></tr><tr><td><a href="directive-dict.html#Override" class="help">Override:</a></td><td>FileInfo</td></tr><tr><td><a href="directive-dict.html#Status" class="help">Status:</a></td><td>Experimental</td></tr><tr><td><a href="directive-dict.html#Module" class="help">Module:</a></td><td>mod_charset_lite</td></tr></table></td></tr></table><usage>
    <p>The <code class="directive">CharsetSourceEnc</code> directive specifies the
    source charset of files in the associated container.</p>

    <p>The value of the <em>charset</em> argument must be accepted
    as a valid character set name by the character set support in
    APR. Generally, this means that it must be supported by
    iconv.</p>
    
<blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><p align="center"><strong>example</strong></p><code>
    &lt;Directory "/export/home/trawick/apacheinst/htdocs/convert"&gt;<br>
    CharsetSourceEnc  UTF-16BE<br>
    CharsetDefault    ISO8859-1<br>
    &lt;/Directory&gt;
</code></td></tr></table></blockquote>
    <p>The character set names in this example work with the iconv
    translation support in Solaris 8.</p>
</usage><hr/><h3 align="center">Apache HTTP Server Version 2.0</h3><a href="./"><img alt="Index" src="../images/index.gif"/></a><a href="../"><img alt="Home" src="../images/home.gif"/></a></blockquote></body></html>