issue with encoding in 5.8

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf issue with encoding in 5.8

  • Creator
    Topic
  • #53327
    Elisha Gould
    Participant

      Hi,

      I’ve noticed in 5.8 the encoding handled differently to 5.6.

      We currently have a 5.6 site that takes a multipart http message using the IB. This contains a pdf document.

      in 5.6 we could just use getmsg to grab the message and ibmimecreate to grab the document and header information.

      In 5.8 when this is attempted ibmimecreate will fail if the NetConfig encoding is set to binary.

      If it is set to ASCII or UTF-8 then it grabs the document and saves it, but the encoding of the file is wrong, so it cannot be read.

      has anyone else had issues with ibmimecreate and 5.8?

      Otherwise does anyone know how to fix the enconding so that it goes back to the correct format?

    Viewing 1 reply thread
    • Author
      Replies
      • #77291
        Elisha Gould
        Participant

          For reference in regards to a fix this issue under 5.8.

          For the ibmime library to work correctly, the thread encoding needs to be set to ASCII or UTF8.

          To get the the data in the correct encoding, the encoding needs to be converted to the ‘identity’ encoding.

          ie something equivalent to the following:

          set myMimeMsg [msgget $aMsgId]

          set myMimeHandle [ibmimecreate $myMimeMsg]

          set myMimeAttachment [ibpartcontentget $myMimeHandle 1]

          set myData [encoding convertto identity $myMimeAttachment]

          #To save a file:

          set myFd [open $myFile w]

          fconfigure $myFd -translation binary

          puts -nonewline $myFd $myData

          close $myFd

        • #77292
          Jim Kosloskey
          Participant

            Elisha,

            Thanks – that is valuable information.

            email: jim.kosloskey@jim-kosloskey.com 30+ years Cloverleaf, 60 years IT – old fart.

        Viewing 1 reply thread
        • The forum ‘Cloverleaf’ is closed to new topics and replies.