Perhaps, like me you were not strictly using a JDBC feature (Writing to a Dataqueue, in my instance), so the auto-magical encoding didn't apply to you since we're communicating through multiple APIs.
My issue was similar to @scottyab's issue with certain characters not mapping. In my case, the example code I was referencing worked perfectly, but writing an xml string to a dataqueue resulted in [ being replaced with £.
As a web developer working with a pre-existing database backend with decades of information, I didn't simply have the ability to "right" the "mis-configuration" as one other commenter suggests.
However, I was able to see which Coded Character Set Identifier the i was likely using by issuing a command to the 400 to display file field information on a known good file: DSPFFD *LIB*/*FILE*
.
Doing so gave me good information, including the specific CCSID set:
After some information sought on CCSIDs, I ran into a page on IBM for EBCDIC with key information printed on the page (since that has a habit of disappearing):
Version 11.0.0 Extended Binary Coded Decimal Interchange Code (EBCDIC)
is an encoding scheme that is typically used on zSeries (z/OS®) and
iSeries (System i®).
And most helpful:
Some example EBCDIC CCSIDs are 37, 500, and 1047.
Since I already learned from this question itself that Cp1047
is another good character set to try (This time, the £ turned into an accented "Y"), I tried Cp37
to see no such charsset existed, but attempted Cp037
and got the right encoding.
It looks like the key is finding which Coded Character Set Identifier (CCSID) is used in your system, and ensuring that your jt400 instance - which otherwise is working perfecting - matches up 100% to the encoding set on the as400, in my case way before my lifetime and decades of business logic ago.