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

Re: FTPAPI Code Page Question



   Hi Scott,



   AROCH was just a file I used to test with, since it has similar data
   (all text) to the one I'm actually sending.



   I was copying it to a source physical file because CPYTOSTMF does not
   allow me to specify a code page if I'm copying directly from the
   physical (database) file. We are on V5R3.



   What happens is that once I transfer the file with FTP (either ASCII
   or binary mode - makes no difference), I open it in Notepad, then
   File, Save As, and the Encoding drop-down list should be Unicode
   (instead, it's ANSI). The other application insists on Unicode, for
   whatever reason.
   I specified the CCSID(1252) keyword at the record level for the
   physical file I'm copying - no luck. I've also tried switcjing between
   Binay and ASCII - there is no difference.





   On Mon, Apr 21, 2008 at 11:59 AM, Scott Klement
   <[1]sk@xxxxxxxxxxxxxxxx> wrote:

     Hi Francis,
     I'm sorry, but I really don't understand what you're trying to do.
     You
     are copying a physical file to a source physical file.  Why would
     you do
     that?   Then you're copying that to a Windows Latin-1 (CCSID 1252)
     file.
      Not sure why...
     Then you say that SOMETHING -- you didn't say what -- reports the
     file
     as 'ANSI'.
     Sorry, but I'm completely lost.
     What encoding DO you want the file to be in?  UTF-8?  UCS-2?
     UTF-16?
     UTF-32?  (All of these are unicode)
     When you create the original file (looks like it's called AROCH) is
     that
     created specifically for this purpose?  Or is that a file that's
     used by
     many processes on your system?   If it's created just for this
     purpose,
     why not create it in Unicode to begin with?  (RPG has natives
     support
     for the double-byte unicode types)
     UTF-8 (Unicode) and ISO-8859-1 ("ANSI") are identical encodings
     unless
     you have some "special" characters.   Invariant characters like
     letters
     and numbers are IDENTICAL in UTF-8 and ANSI, and therefore it seems
     reasonable that a computer program can't tell the difference
     between
     them.   Perhaps you meant to use UTF-16 instead?

   Francis Lapeyre wrote:
   > I'm having a devil of a time here. Here is what I tried (as a test):
   >
   > CPYF FROMFILE(ARQCCOM/AROCH) TOFILE(FMLLIB/AROCH) TOMBR(AROCH)
   > MBROPT(*REPLACE) FMTOPT(*CVTSRC) SRCOPT(*SEQNBR) SRCSEQ(.01 .01)
   >
   > CPYTOSTMF FROMMBR('/qsys.lib/fmllib.lib/aroch.file/aroch.mbr')
   > TOSTMF('/flapeyre1/testoch.txt') STMFOPT(*REPLACE) STMFCODPAG(1252)
   >
   > Then, I tried to manually transfer the file over to Windows, using
   > the AS/400 FTP client. I transferred it as Binary. I opened it up in
   > Notepad, did a File, Save as, and the Encoding is ANSI (where I
   > expected it to be Unicode).
   >
   > Any other suggestions? I would rather not do any post-processing on
   > the files under Windows, if possible.
   > , but that's my last resort.
   >

   ----------------------------------------------------------------------
   -
   This is the FTPAPI mailing list.  To unsubscribe, please go to:
   [2]http://www.scottklement.com/mailman/listinfo/ftpapi
   ----------------------------------------------------------------------
   -

   --
   Francis Lapeyre
   Da mihi sis crustum Etruscum cum omnibus in eo.

References

   1. mailto:sk@xxxxxxxxxxxxxxxx
   2. http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------