IBM i Global

IBM i Global

Connect, learn, share, and engage with IBM Power.

 View Only
Expand all | Collapse all

Visual Studio Code(Code for IBMi)を使って、FFRPGをコンパイルするとコンパイルリストが文字化けする

  • 1.  Visual Studio Code(Code for IBMi)を使って、FFRPGをコンパイルするとコンパイルリストが文字化けする

    Posted Wed January 17, 2024 09:11 PM
    Edited by Saori Koinuma Fri January 19, 2024 04:53 AM

    Hello,

    I am a member of the Japanese Power team, and this question is about something happening in the Japanese environment.

    Currently, I am testing the development of FFRPG using VSCode(Code for IBMi).

    In the version 7.5 environment, only Japanese characters in the compile list are garbled.

    Could you please give me some advice regarding the garbled characters?

    This does not occur in version 7.4, so I would like to clarify the cause.

    ■Verification procedure

    1. Connect to IBMi server with VSCode

    2. Right-click the source in IFS BROWSER and select Run Action to compile.

    3. Click Open Output to see the compilation list. However, the Japanese characters become garbled.

    The compile command is as follows.

    CRTBNDRPG PGM(QGPL/icafe016) SRCSTMF('/home/KOINUMA/ffrpgsrc/icafe016.rpgle') OPTION(*EVENTF) DBGVIEW(*SOURCE) TGTRLS(*CURRENT) TGTCCSID(*JOB)

    ■Environmental assumptions

    ・Version:7.5

    ・QCCSID:1399 

    ・IBM PASE for i environment variables:

     QIBM_PASE_CCSID=1208

    ・CCSID of user profile:SYSVAL

    ・FFRPG source encoding: UTF8

    ■Other concerns

    I set up to automatically put the source from the PC to IFS using SFTP.

    In version 7.5, the STMF CCSID is 817 819,(The ccsid was written incorrectly. sorry…)

    In version 7.4, the STMF CCSID is 1208, which is different.



    ------------------------------
    Saori Koinuma
    ------------------------------



  • 2.  RE: Visual Studio Code(Code for IBMi)を使って、FFRPGをコンパイルするとコンパイルリストが文字化けする

    Posted Wed January 17, 2024 09:19 PM
    Edited by Jack Woehr Wed January 17, 2024 09:23 PM

    Hello Saori ...

    Can you please file an issue here?



    ------------------------------
    Jack Woehr
    IBM Champion 2021 - 2024
    IBM Qiskit Advocate
    ------------------------------



  • 3.  RE: Visual Studio Code(Code for IBMi)を使って、FFRPGをコンパイルするとコンパイルリストが文字化けする

    Posted Wed January 17, 2024 09:25 PM

    Thank you for your comment.

    I'll try raising it as an issue.



    ------------------------------
    Saori Koinuma
    ------------------------------



  • 4.  RE: Visual Studio Code(Code for IBMi)を使って、FFRPGをコンパイルするとコンパイルリストが文字化けする

    Posted Wed January 17, 2024 09:52 PM

    Excellent! The team pays very close attention to issues raised on Github. Good luck, as a contributor I'll be watching the progress of your issue.



    ------------------------------
    Jack Woehr
    IBM Champion 2021 - 2024
    IBM Qiskit Advocate
    ------------------------------



  • 5.  RE: Visual Studio Code(Code for IBMi)を使って、FFRPGをコンパイルするとコンパイルリストが文字化けする

    Posted Thu January 18, 2024 12:39 AM

    Thank you for giving me the opportunity to raise the issue!

    I immediately drafted the ballot.
    I was wondering where to go for help and was very happy with your help.



    ------------------------------
    Saori Koinuma
    ------------------------------



  • 6.  RE: Visual Studio Code(Code for IBMi)を使って、FFRPGをコンパイルするとコンパイルリストが文字化けする

    Posted Thu January 18, 2024 02:07 AM
    Edited by Satid Singkorapoom Thu January 18, 2024 02:07 AM

    Koinuma-san

    I have a short-term manual solution to address your current problem that may work. You can use IBM i command CHGATR to change CCSID of the IFS file to 1208.   Please try it to see if it helps or not.

    CHGATR OBJ('/home/KOINUMA/ffrpgsrc/icafe016.rpgle') ATR(*CCSID) VALUE(1208)

    For a long term solution, My guess is that you should explore if you can specify any proper control parameter in SFPT tool or not.                                                                      



    ------------------------------
    Chance favors only the prepared mind.
    -- Louis Pasteur
    ------------------------------
    Satid S.
    ------------------------------



  • 7.  RE: Visual Studio Code(Code for IBMi)を使って、FFRPGをコンパイルするとコンパイルリストが文字化けする

    Posted Thu January 18, 2024 02:23 AM
    Edited by Satid Singkorapoom Thu January 18, 2024 02:26 AM

    Assuming that you use SFTP in IBM i PASE, I just found information that IBM i uses the job's attribute LANGID and CNTRYID to set CCSID of an IFS file when the file is created in IFS. If you set LANGID=JPN and CNTRYID=JP for IBM i job that do SFTP of the file to the IFS, the IFS file should have CCSID = 1208.   

    There is also an environment variable that you can use: PASE_DEFAULT_UTF8 set to a value of "Y". 

    So, please check on this.



    ------------------------------
    Chance favors only the prepared mind.
    -- Louis Pasteur
    ------------------------------
    Satid S.
    ------------------------------



  • 8.  RE: Visual Studio Code(Code for IBMi)を使って、FFRPGをコンパイルするとコンパイルリストが文字化けする

    Posted Thu January 18, 2024 01:37 AM
    Edited by Satid Singkorapoom Thu January 18, 2024 02:12 AM

    Dear Koinuma-san

    >>>>>  I set up to automatically put the source from the PC to IFS using SFTP.

    In version 7.5, the STMF CCSID is 817,

    In version 7.4, the STMF CCSID is 1208, which is different   <<<<

    CCSID 1208 = UTF-8 which should be the correct value while CCSID 817 does NOT exist in IBM CCSID list which should mean it is an invalid value and should be the culprit for the problem you encounter. 

    What specific tool did you use for SFTP of the source code file from PC to IBM i IFS?  You should check if you can specify any CCSID control in the tool.   Do you ensure that you do SFTP in binary mode?



    ------------------------------
    Chance favors only the prepared mind.
    -- Louis Pasteur
    ------------------------------
    Satid S.
    ------------------------------



  • 9.  RE: Visual Studio Code(Code for IBMi)を使って、FFRPGをコンパイルするとコンパイルリストが文字化けする

    Posted Fri January 19, 2024 04:28 AM
    Dear Mr. Satid
    Thank you for your comment.
    The SFTP tool used the VSCode extension (SFTP).
    After updating the system environment variables, the STMF CCSID became 1208. Thank you for teaching.
     
    ADDENVVAR ENVVAR(PASE_DEFAULT_UTF8) VALUE(Y) LEVEL(*SYS)
    Thank you for also telling me how to change the ccsid attribute.


    ------------------------------
    Saori Koinuma
    ------------------------------



  • 10.  RE: Visual Studio Code(Code for IBMi)を使って、FFRPGをコンパイルするとコンパイルリストが文字化けする

    Posted Fri January 19, 2024 05:29 AM
    Edited by Satid Singkorapoom Fri January 19, 2024 05:37 AM

    Dear Koinuma-san

    Glad to hear your problem solved. 

    As for the environment variable, I did a Google search with "ibm i sftp ifs ccsid" and found this IBM Technote :  After V7R4 upgrade encoding scheme not compatible utilizing GIFSGATE/CPYFRMSTMF - Gentran Server for iSeries at  https://www.ibm.com/support/pages/after-v7r4-upgrade-encoding-scheme-not-compatible-utilizing-gifsgatecpyfrmstmf-gentran-server-iseries.  Although it is about a different product problem in IBM i and the release is 7.4 but I notice the problem is the "reverse" to your case.  So, I make a guess that setting the environment variable to Y should solve your issue and luckily, it does.     

    Please keep in mind that your setting of the environment variable at *SYS level applies to the entire PASE environment and this MAY cause problem to some other PASE-based app in the future in case there are other app running in your PASE as well.  (Let's prey there is none for now!  :-)   You may want to explore if it is possible to set the env var at *JOB level instead. (I have no idea yet.)  You can do this by using IBM MySupport web site to ask the "how to" question there.    Anyway,  CHGATR command can also be a back=up solution for you.



    ------------------------------
    Chance favors only the prepared mind.
    -- Louis Pasteur
    ------------------------------
    Satid S.
    ------------------------------