Topic
  • 3 replies
  • Latest Post - ‏2014-07-14T15:37:02Z by scott_klement
MathiasLanglet
MathiasLanglet
6 Posts

Pinned topic CCSID(*CHAR : *UTF8) Generates RNF1018

‏2014-07-09T13:18:00Z |

Hi all,

I'm trying to produce an XML file that should adhere to UTF-8 Encoding. Currently my files are coming out as corrupt in a UTF-8 perspective.

I thought I could modify how the program handles character sets by amending the Hspec and adding CCSID(*CHAR : *UTF8). However, this generates a RNF1018 error telling me to change the parameter to either *UTF8 *JOBRUN or numeric representing a CCSID.

This conflict is bothering me.. I did supply *UTF8 and it asks me to correct the error by supplying *UTF8.. WHAT!?

Regards,

Mathias

  • scott_klement
    scott_klement
    245 Posts

    Re: CCSID(*CHAR : *UTF8) Generates RNF1018

    ‏2014-07-09T14:04:03Z  

    Are you compiling for version 7.2?  This is when the CCSID(*UTF8) became available.

    For older releases, you'll need to use an API like iconv() or the IFS open() API to convert to UTF-8.

  • MathiasLanglet
    MathiasLanglet
    6 Posts

    Re: CCSID(*CHAR : *UTF8) Generates RNF1018

    ‏2014-07-09T14:11:22Z  

    Are you compiling for version 7.2?  This is when the CCSID(*UTF8) became available.

    For older releases, you'll need to use an API like iconv() or the IFS open() API to convert to UTF-8.

    Hello Scott,

    Ahh yes of course. We're on 7.1 :) Thanks for clearing that up!

    I did try to use iconv() but it converts 'FLAT PACK HEROES' to '㼠耦d.g⫼⫀'

    Does it have anything to do with the fact that we're using CCSID(*UCS2 : 13488)  in the header? (I'm new to both RPG and IBM i so these concepts are not very clear to me yet)

    Cheers,

    Mathias

     

  • scott_klement
    scott_klement
    245 Posts

    Re: CCSID(*CHAR : *UTF8) Generates RNF1018

    ‏2014-07-14T15:37:02Z  

    Hello Scott,

    Ahh yes of course. We're on 7.1 :) Thanks for clearing that up!

    I did try to use iconv() but it converts 'FLAT PACK HEROES' to '㼠耦d.g⫼⫀'

    Does it have anything to do with the fact that we're using CCSID(*UCS2 : 13488)  in the header? (I'm new to both RPG and IBM i so these concepts are not very clear to me yet)

    Cheers,

    Mathias

     

    I'm guessing that there's a bug in the way you're calling iconv().   Maybe not using pointers the right way?