Skip to main content
Version: 8.2411.x.x RR

CharsetFilter

You can use this filter to convert the HTTP request query and body from one character set to another. If it is not possible to convert a body entirely, then the CharsetFilter tries to convert as much as possible, and replaces all non-convertible chars by a question mark ?.

The CharsetFilter only handles requests of the content type application/x-www-form-urlencoded.

Classname
 ch::nevis::isiweb4::filter::rewrite::CharsetFilter
Library
libRewriteFilters.so.1

Configuration

ConvertFrom

Type: string
Usage Constraints: required

Defines the encoding to convert from. I.E. UTF-8.

ConvertTo

Type: string
Usage Constraints: required

Defines the encoding to convert to. I.E. ISO-8859-1.

ConvertQuery

Type: boolean
Usage Constraints: optional
Default: false

Converts the query if set to true.

ConvertBody

Type: boolean
Usage Constraints: optional
Default: true

Converts the body if set to true.

IncomingCharsetStrategy

Type: enum
Possible values: IGNORE, KEEP, CONVERT
Usage Constraints: optional
Default: CONVERT

Defines the conversion strategy for the body, if the incoming encoding was set but differs from the one set in the attribute ConvertFrom. The following values are available:

  • IGNORE: Ignore the incoming encoding, always convert from ConvertFrom to ConvertTo;
  • KEEP: Keep the incoming encoding, do not convert the body;
  • CONVERT: Try to convert from the incoming encoding to ConvertTo.

You can find an example in the installed nevisProxy package (go to examples/various/CharsetFilter.example).