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

conversion error



   Hi all
   I am using httpapi to send a xml file to a webserver. Everything worked
   fine until I need to create a file in UTF-8. I modified my program as
   follow :
   // delete the file if exists
   If unlink(nomefile) < 0
   ;
      err = errno
   ;

      if err <> ENOENT
   ;
        callp die('unlink(): ' + %str(strerror(err)))
   ;
      EndIf
   ;

   Endif
   ;

   // ** Create a new file with CCSID 1208 for
   utf-8
   //     fd = open(nomefile:O_CREAT+O_WRONLY+O_CODEPAGE:        <---
   before  when it was not necessary in UTF I used codepage and it
   worked
   //                    S_IRWXU+S_IRWXG+S_IRWXO:850)
   ;
   fd = open(nomefile:O_CREAT+O_WRONLY+O_CCSID
   :
                       S_IRWXU+S_IRWXG+S_IRWXO:1208)
   ;
   If fd < 0
   ;

       callp die('open(): ' + %str(strerror(errno)))
   ;
   EndIf
   ;

   callp close(fd)
   ;

   // Open the file again. Since the file already exists and has a CCSID,
   we can enable translation
   fd = open(nomefile:O_WRONLY+O_TEXTDATA)
   ;
   if fd < 0
   ;

      callp die('2 open(): ' + %str(strerror(errno)))  ;
   endif  ;

   On the second open I receive an error : Conversion error
   Can anyone tell me what is wrong?
   thanks in advance
   Mario
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------