[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to specify the codepage on a GEt for an IFS file



Sender: Scott Klement <sk@xxxxxxxxxxxxxxxx>


Hi Loek,

Sorry I did not answer your last message, as you noted, I've been a bit
overwhelmed with trying to learn how to be an editor :)

Right now, I've got some very large changes that I've received from Thomas
Raddatz, and I think it would be a good idea to get those changes
installed before making further changes to FTPAPI, otherwise you'd have to
make your modifications all over again with the new sources.

It seems to me that if you're transferring the file in BINARY mode (i.e.
FTP_Binary(*ON)) that the code already does what you want... it uses the
codepage that you set with FTP_codepg() (using the ASCII code page, since
no translation is being done)  In ASCII mode, however, it's  setting it to
DFT_LOC_CP, and I'm not sure why.  Probably your change only requires one
line of code, as shown here:


  *************************************************
  * If the user hasn't specifically set ASCII
  *  to EBCDIC translation codepages, we'll
  *  set them now.
  *************************************************
 c                   if        wkBinary = *Off
 c                   if        wwExists = *Off
 c                              or wwCP < 1
 **** Change this line:
 c***                eval      wwCP = DFT_LOC_CP
 **** to this:
 c                   eval      wwCP = ebcdicf_cp
 c                   endif
 c                   if        wkUsrXLate = *Off
 c                   callp     ftp_codepg(DFT_RMT_CP: wwCP)
 c                   eval      wkUsrXlate = *Off
 c                   endif
 c                   endif


Then, the code page you specify for the EBCDIC side of the transfer when
you run ftp_codepg() is what the file will be set to.  (Since in ASCII
mode it's being translated to that code page, that should make sense)

I haven't tested this change.  Do you want to it that out, and see if:
   -- does it work?
   -- does it break anything when you don't specify a codepage, or
        when you try transfers using different methods, etc, etc.?

Thanks!


On Tue, 11 Nov 2003, L. Maartens wrote:
>
> The question I have is how to set the codepage of a streamfile during open.
> I can use FTP_codepg, but that will not affect he open, since it always
> opens in the DFT_LOC_CP (37 EBCDIC).
>
> Is this the expected/desired behaviour, and if so, then how can I make the
> open of the streamfile do this in a ASCII codepage.
>
> I Understand that I can first create the file by myself with the required
> Ascii codepage, but I would rather see the FTPAPI do this for me. If you can
> direct me on how to achive this within the spirit of the FTPAPI I will
> gladly supply you with the ammended coding.
>
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubsribe from the list send mail
to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
-----------------------------------------------------------------------