Re: Issues with code page conversion..grateful for any help

Daniel Gross <[email protected]> Mon, 30 Mar 2026 19:46:16 +0200
Newsgroups gmane.comp.lang.as400.rpg
Message-ID <[email protected]>
Hi Sean,

with UTF-8 there is no such thing as a codepage anymore - because UTF-8 is short for "Unicode Transfer Format 8 Bit" - so this is full Unicode. 

If you want your file to be written with a specific CCSID, you have to use QSYS2.IFS_WRITE with the FILE_CCSID parameter.

You can also use this function for UTF-8 - that would be FILE_CCSID=>1208 then - as CCSID 1208 would be UTF-8. 

HTH
Daniel


> Am 30.03.2026 um 19:01 schrieb [email protected]:
> 
> Hello all,
> 
> 
> 
> I am using “QSYS2.IFS_WRITE_UTF8” to generate a UTF8 Output file.
> 
> 
> 
> So far so good … I have data with Polish special characters that must be sent with correct CCSID (870)
> 
> 
> 
> I use
> 
> 
> 
> EXEC SQL     SET :chr870  = CAST(:myData AS CHAR(100) CCSID 870) to convert my data to CCSID 870 but when I write
> 
> To my output file the special characters are not written correctly.
> 
> 
> 
> Any ides on how to write these special characters to UTF8 without losing the code page …
> 
> I have tried a few things but no success yet…  I am hoping the CCSID guru’s out there have a few ideas for me.
> 
> 
> 
> 
> 
> Mit freundlichen Grüßen / Kind regards / Bien à vous,
> 
> 
> 
> Sean
> 
> 
> 
> --
> This is the RPG programming on IBM i (RPG400-L) mailing list
> To post a message email: [email protected]
> To subscribe, unsubscribe, or change list options,
> visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
> or email: [email protected]
> Before posting, please take a moment to review the archives
> at https://archive.midrange.com/rpg400-l.
> 
> Please contact [email protected] for any subscription related questions.
> 
-- 
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: [email protected]
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: [email protected]
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact [email protected] for any subscription related questions.