uudecode and base64 encode in tps proc using library

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf uudecode and base64 encode in tps proc using library

  • Creator
    Topic
  • #50515
    Anonymous

      Hello there,

      A string contains a pdf file. This string is uuencoded. It is required to send this string as a base64 encoded string. I try to uudecode the string and then encode base64 the result in a tps proc using tcl. But it does not work as uudecode is not working correct in my tps tcl proc.

      The uuencoded string is correct, because when calling uudecode.exe (from tcl) the resulting file (a pdf file) is ok.

      Maybe you want to take a look at the tps proc (MUSE_pdf_2p1_intern.tcl and find what is wrong? Or is it not possible to do the uudecode using a lib?

      The data message is in file ORU-02.dat

      BTW:

      (1) I use QDX 4.3 on Windows (no chance to change to another QDX version).  

      (2) uudecode and base64 encode are taken from tcllib 1.10, Maybe there is something better?

      Thanks for any help.

      Roman

      PS: I also tried another way using disk files (MUSE-pdf_2p1_file.tcl):

      (1) write the uuencoded file to disk (works fine),

      (2) calling command line command uudecode.exe on the uuencoded file, this creates a pdf file (works fine),

      (3) read the pdf file from disk into a string variable (does not work, as string is to short), and

      (4) perform a base64 encode on the string (does not work either, I hope due to error in step 3).

      Could not find, what is wrong  with file reading.

    Viewing 0 reply threads
    • Author
      Replies
      • #66425
        Nathan Martin
        Participant

          Hi,

          Try adding this after the open in your second file method:

          fconfigure $fh -translation binary

          (I don’t think the read_file method will work because it assumes you are working with text files and the default translation.)

          Nathan

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