DynamicEBCDICDecoder

Group

Preparsers

Class Name

com.ebd.hub.datawizard.parser.DynamicEBCDICDecoder

Function

This preparser checks the character encoding of a message (ASCII or EBCDIC) and recodes it if necessary.

Configuration File

properties DynamicEBCDICDecoder.properties

Description

This preparser checks the character encoding of a message (ASCII or EBCDIC) and recodes it if necessary.

The check proceeds like the following.

  • Parameter checkchars specifies how many characters are read from the file.

  • Then the algorithm checks which characters can be represented in ASCII and how many cannot.

  • If in the end more characters can be represented in ASCII, an ASCII encoding is assumed, otherwise EBCDIC. Important note: An EBCDIC coded whitespace is represented as @ in ASCII and is therefore recognized as ASCII-representable by the check algorithm. So if you read in a complete file, ASCII erroneously wins whenever there are enough whitespaces in the EBCDIC file. You can prevent this by choosing advantageous values for parameters checkcars and skipchars, i.e. you try to choose values so that the checked text has as few whitespaces as possible.

Parameter Description


Parameter Name

Description

Default Value

checkchars

Number of characters to be checked.

100

skipchars

Number of characters skipped from the beginning of the file during format checking.

0

asciicharset

Character encoding to recognize ASCII input data.

8859_1

ebcdiccharset

Character encoding to recognize EBCDIC input data.

cp273

outcharset

Character encoding for the output data of the preparer.

8859_1

Example

DynamicEBCDICDecoder.properties
checkchars=7
skipchars=0
asciicharset=8859_1
ebcdiccharset=cp273
outcharset=8859_1