summaryrefslogtreecommitdiffstats
path: root/docs/manual/mod/mod_charset_lite.xml
blob: 900a56f0cfdfb0ba32ba80626513e88d1ea57ad1 (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
<?xml version="1.0"?>
<!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
<?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
<modulesynopsis>

<name>mod_charset_lite</name>
<description>Specify character set translation or recoding</description>
<status>Experimental</status>
<sourcefile>mod_charset_lite.c</sourcefile>
<identifier>charset_lite_module</identifier>

<summary>
    <p>This is an <strong>experimental</strong> module and should
    be used with care. Experiment with your
    <module>mod_charset_lite</module> configuration to ensure that it
    performs the desired function.</p>

    <p><module>mod_charset_lite</module> 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. <module>mod_charset_lite</module> does not translate the
    data itself but instead tells Apache what translation to
    perform. <module>mod_charset_lite</module> 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. <module>mod_charset_lite</module>
    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 APR 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
    APR. 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
    APR. 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>
    </dl>
</usage>
</directivesynopsis>

</modulesynopsis>