mod_charset_lite.html revision dff77f20d3ca0296e740d4369989e57949a06e92
2454dfa32c93c20a8522c6ed42fe057baaac9f9aStephan Bosch<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen<!-- Background white, links blue (unvisited), navy (visited), red (active) -->
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen BGCOLOR="#FFFFFF"
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen TEXT="#000000"
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen LINK="#0000FF"
5de0c65da362236080fa699af3da03e45e480ab8Timo Sirainen VLINK="#000080"
5de0c65da362236080fa699af3da03e45e480ab8Timo Sirainen ALINK="#FF0000"
5de0c65da362236080fa699af3da03e45e480ab8Timo Sirainen<!--#include virtual="header.html" -->
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen <H1 ALIGN="CENTER">Module mod_charset_lite</H1>
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen<p>This module provides the ability to specify character set
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen translation or recoding.</p>
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo SirainenHREF="module-dict.html#SourceFile"
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen><STRONG>Source File:</STRONG></A> mod_charset_lite.c
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo SirainenHREF="module-dict.html#ModuleIdentifier"
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen><STRONG>Module Identifier:</STRONG></A> charset_lite_module
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen This is an <STRONG>experimental</STRONG> module and should be used with
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen care. Experiment with your <CODE>mod_charset_lite</CODE> configuration to
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen ensure that it performs the desired function.
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen <CODE>mod_charset_lite</CODE> allows the administrator to specify the
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen source character set of objects as well as the character set they should
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen be translated into before sending to the client.
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen <CODE>mod_charset_lite</CODE> does not translate the data itself but
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen instead tells Apache what translation to perform.
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen <CODE>mod_charset_lite</CODE> is applicable to EBCDIC and ASCII
d861bc0977b229cdaeb3fb77377e2a2bd9d40d3dTimo Sirainen host environments. In an EBCDIC environment, Apache normally translates
661998e2ccd772ad92a9d4a75cb712692a8c94b3Timo Sirainen text content from the code page of the Apache process locale to
bb11a1957aefbd2a2edf7ae25af4032899c34c41Martti Rannanjärvi ISO-8859-1. <CODE>mod_charset_lite</CODE> can be used to specify that
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen a different translation is to be performed. In an ASCII environment,
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen Apache normally performs no translation, so <CODE>mod_charset_lite</CODE>
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen is needed in order for any translation to take place.
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen <p>This module will only work if <code>APACHE_XLATE</code> is defined
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen at compile time.</p>
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen This module provides a small subset of configuration mechanisms
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen implemented by Russian Apache and its associated <CODE>mod_charset</CODE>.
cf41318871bd42358df3420e50614f5310b08c77Martti Rannanjärvi <LI><A HREF="#charsetsourceenc">CharsetSourceEnc</A>
cf41318871bd42358df3420e50614f5310b08c77Martti Rannanjärvi <LI><A HREF="#charsetdefault">CharsetDefault</A>
cf41318871bd42358df3420e50614f5310b08c77Martti Rannanjärvi <LI><A HREF="#charsetoptions">CharsetOptions</A>
d861bc0977b229cdaeb3fb77377e2a2bd9d40d3dTimo Sirainen The character set name parameters of CharsetSourceEnc and CharsetDefault
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen must be acceptable to the translation mechanism used by APR on the system
bb11a1957aefbd2a2edf7ae25af4032899c34c41Martti Rannanjärvi where mod_charset_lite is deployed. These character set names are not
bb11a1957aefbd2a2edf7ae25af4032899c34c41Martti Rannanjärvi standardized and are usually not the same as the corresponding values used
2e07e3182f355cf04a1461dd7f893d0ebc818764Timo Sirainen in http headers. Currently, APR can only use iconv(3), so you can easily
a022e47f45597650f71f00c3af3fa783982a65adTimo Sirainen test your character set names using the iconv(1) program, as follows:
a022e47f45597650f71f00c3af3fa783982a65adTimo Sirainen iconv -f charsetsourceenc-value -t charsetdefault-value
bb11a1957aefbd2a2edf7ae25af4032899c34c41Martti Rannanjärvi <H3>Mismatch between character set of content and translation rules</H3>
bb11a1957aefbd2a2edf7ae25af4032899c34c41Martti Rannanjärvi If the translation rules don't make sense for the content, translation
a022e47f45597650f71f00c3af3fa783982a65adTimo Sirainen can fail in various ways, including:
a022e47f45597650f71f00c3af3fa783982a65adTimo Sirainen The translation mechanism may return a bad return code, and the connection
47a5a7e8296f3b8f2fac9a0659d4de3f2723ba4aMartti Rannanjärvi will be aborted.
661998e2ccd772ad92a9d4a75cb712692a8c94b3Timo Sirainen The translation mechanism may silently place special characters (e.g., question
661998e2ccd772ad92a9d4a75cb712692a8c94b3Timo Sirainen marks) in the output buffer when it cannot translate the input buffer.
588a0579058849aed9f7b59d8259e0c58d9fd23cTimo Sirainen <H2><A NAME="charsetsourceenc">CharsetSourceEnc</A></H2>
588a0579058849aed9f7b59d8259e0c58d9fd23cTimo Sirainen ><STRONG>Syntax:</STRONG></A> CharsetSourceEnc <EM>charset</EM>
588a0579058849aed9f7b59d8259e0c58d9fd23cTimo Sirainen ><STRONG>Context:</STRONG></A> directory, virtual host
5de0c65da362236080fa699af3da03e45e480ab8Timo Sirainen ><STRONG>Override:</STRONG></A> <EM>FileInfo</EM>
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen ><STRONG>Module:</STRONG></A> mod_charset_lite
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen The <CODE>CharsetSourceEnc</CODE> directive specifies the source charset
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen of files in the associated container.
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen The value of the <EM>charset</EM> argument must be accepted as a valid
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen character set name by the character set support in APR. Generally, this
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen means that it must be supported by iconv.
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen <Directory "/export/home/trawick/apacheinst/htdocs/convert">
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen CharsetSourceEnc UTF-16BE
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen CharsetDefault ISO8859-1
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen </Directory>
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen The character set names in this example work with the iconv
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen translation support in Solaris 8.
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen <H2><A NAME="charsetdefault">CharsetDefault</A></H2>
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen ><STRONG>Syntax:</STRONG></A> CharsetDefault <EM>charset</EM>
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen ><STRONG>Context:</STRONG></A> directory, virtual host
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen ><STRONG>Override:</STRONG></A> <EM>FileInfo</EM>
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen ><STRONG>Module:</STRONG></A> mod_charset_lite
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen The <CODE>CharsetDefault</CODE> directive specifies the charset that
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen content in the associated container should be translated to.
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen The value of the <EM>charset</EM> argument must be accepted as a valid
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen character set name by the character set support in APR. Generally, this
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen means that it must be supported by iconv.
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen <Directory "/export/home/trawick/apacheinst/htdocs/convert">
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen CharsetSourceEnc UTF-16BE
0d1d485939b9b7f1a0f588aea40c504e3d26e35bJ. Nick Koston CharsetDefault ISO8859-1
0d1d485939b9b7f1a0f588aea40c504e3d26e35bJ. Nick Koston </Directory>
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen <H2><A NAME="charsetoptions">CharsetOptions</A></H2>
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen ><STRONG>Syntax:</STRONG></A> CharsetOptions <EM>option</em>
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen ><STRONG>Default:</STRONG></A> <EM>DebugLevel=0</EM> <EM>NoImplicitAdd</EM>
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen ><STRONG>Context:</STRONG></A> directory, virtual host
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen ><STRONG>Override:</STRONG></A> <EM>FileInfo</EM>
1f2f38f518ea14d1042c98ab039e6df053f7b285Timo Sirainen ><STRONG>Module:</STRONG></A> mod_charset_lite
<!--#include virtual="footer.html" -->