<-
Apache > HTTP Server > Documentation > Version 2.4 > Modules

Apache Module mod_a2e

Description:Early-running filter that converts UTF-8/ASCII to IBM-1047
Status:Experimental
Module Identifier:a2e_module
Source File:mod_a2e.c

Summary

mod_a2e provides an output filter named "A2E". This filter converts responses from non-EBCDIC codepages to EBCDIC codepages early during server processing. This is useful because most text processing within the server only operates against EBCDIC content. For example, adding this module allows filteirng of proxied responses by modules such as mod_substitute

This module is copied and derived from mod_charset_lite with defaults updated to make it as simple to perform UTF8 to EBCDIC conversion on content that does not start off as EBCDIC

This module was added with APAR PI96955

Directives

Topics

top

Example

Proxied responses are typically already in non-EBCDIC codepages, so modules such as mod_substitute cannot modify their bodies and mod_charset_lite knows to not implicitly convert from EBCDIC as the response is written. With the following configuration changes, the server can apply this type of text filter.

LoadModule a2e_module modules/mod_a2e.so
ProxyPass /app/ http://example.com/app/
<Location /app/>
    # mod_charset_lite is normally used for E2A and won't operate on proxied responses by default 
    CharsetOptions TranslateProxy
    # Add the filter provided by mod_a2e for UTF8 to IBM1047 by default. 
    SetOutputFilter A2E
</Location>
AddOutputFilterByType SUBSTITUTE text/html
# Needed for AddOutputFilterByType to operate on error documents:
# SetEnv filter-errordocs
Substitute "s/beta.example.com/www.example.com/"
top

A2EDCharsetDefault Directive

Description:Charset to translate into
Syntax:A2ECharsetDefault charset
Default:A2ECharsetDefault IBM-1047
Context:server config, virtual host, directory, .htaccess
Override:FileInfo
Status:Experimental
Module:mod_a2e

The A2ECharsetDefault directive specifies the charset that content in the associated container should be translated to.

The value of the charset 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.

In a typical configuration where this modules "A2E" filter is used in front of the translation performed by mod_charset_lite, A2ECharsetDefault should match mod_charset_lite's CharsetSourceEnc

top

A2EOptions Directive

Description:Configures charset translation behavior
Syntax:A2EOptions option [option] ...
Default:A2EOptions DebugLevel=0 TranslateProxy NoTranslateRequestBodies NoImplicitAdd
Context:server config, virtual host, directory, .htaccess
Override:FileInfo
Status:Experimental
Module:mod_a2e

The A2EOptions directive configures certain behaviors of mod_a2e. Option can be one of

DebugLevel=n
The DebugLevel keyword allows you to specify the level of debug messages generated by this module. The range is 0 (none) through 9 (verbose).
ImplicitAdd | NoImplicitAdd
It is not recommended to change this setting from the default of "NoImplicitAdd". This filter should only be explicitly added when the input codepage of the enabled scope is certain.
TranslateAllMimeTypes | NoTranslateAllMimeTypes
Normally, this module 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.
TranslateRequestBodies | NoTranslateRequestBodies
This module defaults to working on response bodies only. In some obscure cases it may be useful to set "TranslateRequestBodies" when a boby needs to be transformed but is not in EBCDIC. The "A2E" input filter would still need to be explicitly added.
top

A2ESourceEnc Directive

Description:Source charset of files
Syntax:A2ESourceEnc charset
Default:A2ESourceEnc UTF-8
Context:server config, virtual host, directory, .htaccess
Override:FileInfo
Status:Experimental
Module:mod_a2e

The A2ESourceEnc directive specifies the source charset of files in the associated container.

The value of the charset 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.