summaryrefslogtreecommitdiffstats
path: root/docs/manual/mod/mod_charset_lite.html
blob: 6b8ccf963b1177844fcdd8081f3d88eb15cba110 (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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta name="generator" content="HTML Tidy, see www.w3.org" />

    <title>Apache module mod_charset_lite</title>
  </head>
  <!-- Background white, links blue (unvisited), navy (visited), red (active) -->

  <body bgcolor="#FFFFFF" text="#000000" link="#0000FF"
  vlink="#000080" alink="#FF0000">
    <!--#include virtual="header.html" -->

    <h1 align="CENTER">Module mod_charset_lite</h1>

    <p>This module provides the ability to specify character set
    translation or recoding.</p>

    <p><a href="module-dict.html#Status"
    rel="Help"><strong>Status:</strong></a> Experimental<br />
     <a href="module-dict.html#SourceFile"
    rel="Help"><strong>Source File:</strong></a>
    mod_charset_lite.c<br />
     <a href="module-dict.html#ModuleIdentifier"
    rel="Help"><strong>Module Identifier:</strong></a>
    charset_lite_module</p>

    <h2>Summary</h2>

    <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>mod_charset_lite</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>mod_charset_lite</code> does not translate
    the data itself but instead tells Apache what translation to
    perform. <code>mod_charset_lite</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>mod_charset_lite</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>mod_charset_lite</code> is needed in order for any
    translation to take place.</p>

    <p>This module will only work if <code>APACHE_XLATE</code> is
    defined at compile time.</p>

    <p>This module provides a small subset of configuration
    mechanisms implemented by Russian Apache and its associated
    <code>mod_charset</code>.</p>

    <h2>Directives</h2>

    <ul>
      <li><a href="#charsetsourceenc">CharsetSourceEnc</a></li>

      <li><a href="#charsetdefault">CharsetDefault</a></li>

      <li><a href="#charsetoptions">CharsetOptions</a></li>
    </ul>

    <h2>Common Problems</h2>

    <h3>Invalid character set names</h3>

    <p>The character set name parameters of CharsetSourceEnc and
    CharsetDefault must be acceptable to the translation mechanism
    used by APR on the system where mod_charset_lite 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>
<pre>
  iconv -f charsetsourceenc-value -t charsetdefault-value
 
</pre>

    <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 id="charsetsourceenc"
    name="charsetsourceenc">CharsetSourceEnc</a></h2>

    <p><a href="directive-dict.html#Syntax"
    rel="Help"><strong>Syntax:</strong></a> CharsetSourceEnc
    <em>charset</em><br />
     <a href="directive-dict.html#Default"
    rel="Help"><strong>Default:</strong></a> <em>None</em><br />
     <a href="directive-dict.html#Context"
    rel="Help"><strong>Context:</strong></a> directory, virtual
    host<br />
     <a href="directive-dict.html#Override"
    rel="Help"><strong>Override:</strong></a>
    <em>FileInfo</em><br />
     <a href="directive-dict.html#Status"
    rel="Help"><strong>Status:</strong></a> Experimental<br />
     <a href="directive-dict.html#Module"
    rel="Help"><strong>Module:</strong></a> mod_charset_lite<br />
    </p>

    <p>The <code>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>
    Example: 
<pre>
    &lt;Directory "/export/home/trawick/apacheinst/htdocs/convert"&gt;
    CharsetSourceEnc  UTF-16BE
    CharsetDefault    ISO8859-1
    &lt;/Directory&gt;
 
</pre>
    The character set names in this example work with the iconv
    translation support in Solaris 8. 
    <hr />

    <h2><a id="charsetdefault"
    name="charsetdefault">CharsetDefault</a></h2>

    <p><a href="directive-dict.html#Syntax"
    rel="Help"><strong>Syntax:</strong></a> CharsetDefault
    <em>charset</em><br />
     <a href="directive-dict.html#Default"
    rel="Help"><strong>Default:</strong></a> <em>None</em><br />
     <a href="directive-dict.html#Context"
    rel="Help"><strong>Context:</strong></a> directory, virtual
    host<br />
     <a href="directive-dict.html#Override"
    rel="Help"><strong>Override:</strong></a>
    <em>FileInfo</em><br />
     <a href="directive-dict.html#Status"
    rel="Help"><strong>Status:</strong></a> Experimental<br />
     <a href="directive-dict.html#Module"
    rel="Help"><strong>Module:</strong></a> mod_charset_lite<br />
    </p>

    <p>The <code>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>
    Example: 
<pre>
    &lt;Directory "/export/home/trawick/apacheinst/htdocs/convert"&gt;
    CharsetSourceEnc  UTF-16BE
    CharsetDefault    ISO8859-1
    &lt;/Directory&gt;
 
</pre>
    <hr />

    <h2><a id="charsetoptions"
    name="charsetoptions">CharsetOptions</a></h2>

    <p><a href="directive-dict.html#Syntax"
    rel="Help"><strong>Syntax:</strong></a> CharsetOptions
    <em>option</em> [<em>option</em>] ...<br />
     <a href="directive-dict.html#Default"
    rel="Help"><strong>Default:</strong></a> <em>DebugLevel=0</em>
    <em>NoImplicitAdd</em><br />
     <a href="directive-dict.html#Context"
    rel="Help"><strong>Context:</strong></a> directory, virtual
    host<br />
     <a href="directive-dict.html#Override"
    rel="Help"><strong>Override:</strong></a>
    <em>FileInfo</em><br />
     <a href="directive-dict.html#Status"
    rel="Help"><strong>Status:</strong></a> Experimental<br />
     <a href="directive-dict.html#Module"
    rel="Help"><strong>Module:</strong></a> mod_charset_lite<br />
    </p>

    <p>The <code>CharsetOptions</code> directive configures certain
    behaviors of <code>mod_charset_lite</code>. <em>Option</em> can
    be one of</p>

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

      <dd>The <samp>DebugLevel</samp> keyword allows you to specify
      the level of debug messages generated by
      <code>mod_charset_lite</code>. By default, no messages are
      generated. This is equivalent to <samp>DebugLevel=0</samp>.
      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 <samp>ImplicitAdd</samp> keyword specifies that
      <code>mod_charset_lite</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,
      <samp>NoImplicitAdd</samp> should be specified so that
      <code>mod_charset_lite</code> doesn't add its filter.</dd>
    </dl>
    <br />
     <br />
     <!--#include virtual="footer.html" -->
  </body>
</html>