DFDL encoding information
When an integration node calls a parser or serializer, the integration node
provides the parser or serializer with encoding information that defines
the character encoding (CCSID) and numeric encoding (byte order and
floating point representation) of the data that is to be parsed or serialized.
When
parsing or serializing messages in the DFDL domain, the DFDL parser
or DFDL serializer is called. The way that the DFDL parser and DFDL
serializer use encoding information is defined by your DFDL message
model.
In a DFDL message model, you must set the character encoding (CCSID)
and numeric encoding (byte order and floating point representation)
by using DFDL properties on each type definition. DFDL predefines
a set of external variables, each of which has default values that
can be externally overridden. It is these predefined variables that
the integration node overrides to pass in encoding information. For more information
about DFDL predefined variables, see DFDL predefined variables in IBM Integration Bus.
If you have set the encoding properties in your DFDL message model
to specific, static types, the DFDL parser and DFDL serializer interpret
message data by using this static encoding information, and ignore
the encoding information that is provided by the integration node for each individual
message instance. Note that if you set the encoding properties in
your DFDL message model to specific, static types, and the message
data is not encoded in the format that you specified, you might encounter
the following problems:
- Parsing errors due to the message data being interpreted incorrectly
- Incorrect numeric values due to the wrong byte order (endianness)
being used
To avoid these problems, set the DFDL encoding properties in your
DFDL message model as follows:
- encoding: {dfdl:encoding}
- byteOrder: {dfdl:byteOrder}
- binaryFloatRep: {dfdl:binaryFloatRep}
These settings allow the DFDL parser to correctly
interpret your data by using the encoding information that the integration node
obtains for an individual message instance, for example from the transport
headers in an input message. Similarly, these settings ensure that
bit stream data is encoded according to the values that are defined
in the integration node properties, when the data is processed by the DFDL serializer.