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

FTPAPI: Problem with FTP_LIST and filenames with "special" characters



   When receiving a list of files and directories from a NAS drive via FTP
   I had a problem with one of
   the names containing the letter "Å" ( hex x'C5' ). It was not converted
   to the right EBCDIC character.


   I found out that the problem was that the ascii code page used for the
   conversion was code page 437
   which might be OK for American purposes but inadequate for European
   purposes.

   Here code page 1252 should be used instead.


   [1]https://en.wikipedia.org/wiki/Windows-1252


   The procedures ToASCII and ToEBCDIC calls procedure initiconv.

   Here is an extract of the code from  initiconv

   .

   .

         * Initialize ASCII conv table:

        c                   eval      wkEBCDIC_cp = rtvJobCp

        c                   eval      wkDsToASC =
   iconv_open(%addr(wkDsASCII)  :

       c
   %addr(wkDsEBCDIC) )

   .

   .

   .

         * Initialize EBCDIC conv table:

        c                   eval      wkDsToEBC =
   iconv_open(%addr(wkDsEBCDIC) :

        c
   %addr(wkDsASCII)  )


   The problem is the data structure wkDsASCII and the constant DFT_RMT_CP

         ** Default remote codepage

        D DFT_RMT_CP      C                   CONST(437)



        D  wkDsASCII      DS                  occurs(MAX_SESSION)

        D   wkASCII_cp                  10I 0 INZ(DFT_RMT_CP)

        D   wkASCII_ca                  10I 0 INZ(0)

        D   wkASCII_sa                  10I 0 INZ(0)

        D   wkASCII_ss                  10I 0 INZ(1)

        D   wkASCII_il                  10I 0 INZ(0)

        D   wkASCII_eo                  10I 0 INZ(1)

        D   wkASCII_r                    8A   INZ(*allx'00')



   The procedure FTP_codePage cannot be used to change this.


   I have tried to debug through the FTPAPI and modify the default value
   from 437 to 1252 before it was
   used in procedure initiconv. Then continued to the FTP_list procedure
   and now the filename was converted to
   the right value.


   So can we have the default changed from 437 to 1252?


   Kind regards

   Peder Udesen


   This email and any files transmitted with it may be confidential and
   intended solely for the use of the individual or entity to which they
   are addressed. If you have received this email in error please notify
   the sender.

References

   1. https://en.wikipedia.org/wiki/Windows-1252
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------