Apache Module mod_charset_lite

Summary

mod_charset_lite allows the server to change
the character set of responses before sending them to the client.
In an EBCDIC environment, Apache always translates HTTP protocol
content (e.g. response headers) from the code page of the Apache
process locale to ISO-8859-1, but not the body of responses. In
any environment, mod_charset_lite can be used to
specify that response bodies should be translated. For example,
if files are stored in EBCDIC, then
mod_charset_lite can translate them to
ISO-8859-1 before sending them to the client.

This module provides a small subset of configuration
mechanisms implemented by Russian Apache and its associated
mod_charset.

Directives

Topics

Invalid character set names

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:

iconv -f charsetsourceenc-value -t charsetdefault-value

Mismatch between character set of content and translation
rules

If the translation rules don't make sense for the content,
translation can fail in various ways, including:

The translation mechanism may return a bad return code,
and the connection will be aborted.

The translation mechanism may silently place special
characters (e.g., question marks) in the output buffer when
it cannot translate the input buffer.

The CharsetOptions directive configures certain
behaviors of mod_charset_lite. Option can
be one of

DebugLevel=n

The DebugLevel keyword allows you to specify
the level of debug messages generated by
mod_charset_lite. By default, no messages are
generated. This is equivalent to DebugLevel=0.
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
mod_charset_lite.c.

ImplicitAdd | NoImplicitAdd

The ImplicitAdd keyword specifies that
mod_charset_lite 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, NoImplicitAdd
should be specified so that mod_charset_lite
doesn't add its filter.

TranslateAllMimeTypes | NoTranslateAllMimeTypes

Normally, mod_charset_lite will only perform
translation on a small subset of possible mimetypes. When the
TranslateAllMimeTypes keyword is specified for a given
configuration section, translation is performed without regard for
mimetype.

Notice: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 mailing lists.