Details
-
Improvement
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
3.9.0
-
None
-
Unknown
Description
A popular trend lately is to send UTF-8 JSON data through data queues on IBM i.
Currently, the JT400 components has a `format` parameter that can be either "binary" or "text". This parameter affects how the component interprets both the data queue key as well as the data queue data.
JSON is text, but unfortunately the CCSID (encoding) used for text mode assumes the CCSID of the connection, and IBM i does not support unicode connections!
In order to properly read UTF-8 data from the queue, you need to use `format=binary` and then convert to String manually (for instance, with `.convertBodyTo(String.class, "UTF-8")`).
This isn't all-in-all horrible, but I've seen it catch a decent number of people. This should be addressed by either or both of:
- Having a UTF-8 example in the doc
- Providing a new `dataQueueCCSID` parameter that allows for the explicit declaration of CCSID read from the data independent from the connection CCSID