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

Re: FTPAPI Code Page Question



   Thanks, Scott. I'll probably have to go the CPYTOSTMF route for now;
   this is a very hot project that can't wait.

   On Thu, Apr 17, 2008 at 12:54 PM, Scott Klement
   <[1]sk@xxxxxxxxxxxxxxxx> wrote:

     Hi Francis,
     In it's current state, FTPAPI only supports single-byte character
     sets.
      So you can't use it to translate to UTF-8 (CCSID 1208) since
     that's a
     mixed-byte CCSID.
     To achieve the results you're looking for, you'll need to modify
     FTPAPI's method of translating data...  if you do so, please
     contribute
     your changes back to the project.
     Another approach might be to work around the problem.  If you want
     to do
     that, my suggestion is to use CPYTOSTMF to convert it to a
     (temporary)
     IFS stream field that's in UTF-8, then send that stream file with
     FTPAPI
     in binary mode.

   Francis Lapeyre wrote:
   >    I'm tranferring a physical file (a flat one) to a MS SQL Server
   2005
   >    application. It expects the file to be in Unicode, but it's
   appearing
   >    over there as ASCII, and that doesn't work.
   >
   >
   >
   >    What do I need to do? A quick Google seems to indicate that CCSID
   1208
   >    is Unicode; I tried this in my program:
   >
   >
   >
   >    // Switch to ASCII mode.
   >
   >    If Ftp_Binarymode(File_Id : *OFF) < 0;
   >      P_Error = 'Cannot switch to ASCII mode. Check FTP Server.';
   >      Exsr End_Program;
   >
   >    Endif;
   >
   >
   >
   >    // Files must be in Unicode CCSID (1208).
   >
   >    If Ftp_Codepage(File_Id : 1208 : 37) < 0;
   >      P_Error = 'Cannot translate files to Unicode. Check FTP
   Server.';
   >      Exsr End_Program;
   >
   >    Endif;
   >
   >
   >
   >    That did not work. On the desination server, if you open the file
   in
   >    Notepad, File, Save as, the type is showing up as ANSI.
   >
   >

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