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

Re: Code page translation



Sender: "L. Maartens" <l.maartens@xxxxxxxxx>

Hi Randy,

This is a issue that Scott did already solve for me once:

I have only recently began to test the proposed solution, and it does indeed
work  (actually, who would doubt the master...)

(You could also search the archive. It should pop up.)


See the following reply.


Sender: Scott Klement <sk@xxxxxxxxxxxxxxxx>


Hi Loek,

<SNIP>
</SNIP>

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
-----------------------------------------------------------------------



----- Original Message -----
From: <randyj@xxxxxxxxxxxxx>
To: <ftpapi@xxxxxxxxxxxxx>
Sent: Thursday, September 16, 2004 2:19 AM
Subject: Code page translation


> Sender: randyj@xxxxxxxxxxxxx
>
> I'm fairly new to this.
>
> I'm GETing files from an NT based box to a native file.  They arrive with
a
> CCSID of 65535.  I tried calling the procedure 'ftp_codepg(FTP_ASC_CP:
> FTP_EBC_CP)' after connecting but the results are the same.  Naming format
> is 0. Tips?
>
> Randy Jacobson
>
>
> -----------------------------------------------------------------------
> This is the FTPAPI mailing list.  To unsubsribe from the list send mail
> to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
> -----------------------------------------------------------------------
>

-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubsribe from the list send mail
to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
-----------------------------------------------------------------------