IBM / JTOpen

IBM Toolbox for Java, an IBM i communications library
https://ibm.github.io/JTOpen/
Other
56 stars 26 forks source link

Maybe a problem with AS400Message #174

Open 4E71-NOP opened 3 months ago

4E71-NOP commented 3 months ago

Hello,

First of all. Awesome tools!!! Keep it alive.


I'm not sure it's a bug but I can't find a workaround on this issue. I have trouble with the returned messages from a command.

Synptoms

I do something like this.

            // commandTerm type is CommandCall
            retResp = commandTerm.run(cmd);
            if (!retResp) {
                StringBuilder errorMessages = new StringBuilder();
                AS400Message[] l1 = commandTerm.getMessageList();

                for (int i = 0; i < l1.length; i++) {
                    errorMessages.append(l1[i].getSeverity() + " : " + l1[i].getText() + "\n");
                }
        // some code to log somewhere

            }

I get :

30 : Non autorisä § la commande XXXXX de la bibliothüque *LIBL.
30 : Erreur trouväe dans la commande XXXXX.

instead of: 30 : Non autorisé à la commande XXXXX de la bibliothèque *LIBL. 30 : Erreur trouvée dans la commande XXXXX.

for french localization.


I was connected to PUB400.com

dspsysval qccsid shows:
[...]
Coded character set                          
  identifier . . . . . :   273        1-65535

State of the entry in the array

textCcsid = 65535 l1[i].getTextCcsidConversionStatusIndicator() = 1

"1 No conversion occurred because either the message or message help text was 65535 or the CCSID you wanted the message or message help text converted to was 65535."

History

I tried to use textConverter, AS400Text but it's worst.

Conclusion

To me :

We're left with

Nota Bene : is not exclusive to french.

Thx for your time.

jeber-ibm commented 3 months ago

It could be that the CCSID is not set correctly for the job handling the command request. Typically, that CCSID will come from the user profile of the connecting user. You can start by checking the profile of the user that is connecting to make sure it is not 65535.