IBM I 7.1
Customer wants a UTF-8 text file, so we created a PF with data encoded as CCSID(1208) and used FTP to do a PUT (Using BINARY mode) onto their FTP server (NOT IBM I, probably Windows, not sure).
The customer came back and indicated that what they /really/ needed is UTF-8 with <CR><LF> delimiters on each record.
When using IBM i to PUT an EBCDIC-encoded [ for example, CCSID(37) ] to another system, if BINARY is not specified on the PUT then FTP will translate the EBCDIC to ASCII and put <CR><LF> on each record on the target file. We tried using FTP with the CCSID(1208) file, and it seems that IBM i FTP also translates CCSID(1208) to ASCII during the PUT.
After much experimentation and frustration, the solution which I devised was to use CPYTOIMPF to copy the UTF-8 PF to an IFS file:
CPYTOIMPF FROMFILE(UTF8FILE) TOSTMF('/home/steve/test.txt') MBROPT(*REPLACE) RCDDLM(*CRLF) STRDLM(*NONE) RMVBLANK(*TRAILING)
Then used FTP to PUT the IFS file (using BINARY mode) to the target system.
This gave them what they wanted - Is there a better way?