We have a program that returns a string. This has worked with other programs but it seems that this case has some encoding that is not working with the output. The IBM programmers are not familiar with the encoding issue but see it is valid at the end of the program before it's returned to JTOpen.
In the non-JTOpen response the value: Delivered
In the Node program running JTOpen: \u0004ᅤᅮ¥ᅤᅤᅣ
When displaying the output in Postman: ᅤᅮ¥ᅤᅤᅣ
Is there some way to enforce or modify encoding after it comes from the JTOpen regarding strings?
I did see this in code but may be incorrect:
Due to the format returned from a multi-bite array with very limited range -128 to 127,
there will be conversions that flip to negative when not supposed to, by changing the character
code by +64, the result always corresponds to the proper string character
That function attempts to fix the encoding with this small loop
for (let i = 0; i < array.length; i++) { const number = array[i] + 128; result += String.fromCharCode(number); }
We have a program that returns a string. This has worked with other programs but it seems that this case has some encoding that is not working with the output. The IBM programmers are not familiar with the encoding issue but see it is valid at the end of the program before it's returned to JTOpen.
In the non-JTOpen response the value:
Delivered
In the Node program running JTOpen:\u0004ᅤᅮ¥ᅤᅤᅣ
When displaying the output in Postman:ᅤᅮ¥ᅤᅤᅣ
Is there some way to enforce or modify encoding after it comes from the JTOpen regarding strings? I did see this in code but may be incorrect:
for (let i = 0; i < array.length; i++) { const number = array[i] + 128; result += String.fromCharCode(number); }