Base 64 encoding and decoding of binary data in a text file?

Base 64 encoding and decoding of binary data in a text file?

7
NewbieNewbie
7

    Jan 20, 2010#1

    Anyone know of a step-by-step to correctly using the new (in 15.20) "Base 64 encoding and decoding" feature?

    I have been awaiting this feature; and have been using Notepad++ when I've needed it.

    However, I cannot seem to figure out how it works in UE.

    Using the working excerpt, below, in Notepad++ I highlight all the lines starting at "UE" and ending at "CQAAAAA=" and copy&paste just those lines into a new edit window; highlight those lines in the new edit window ("Select All"), and then select Base64 Decode. I end up with GetTableFields.zip "displayed" in that new edit window (looks like garbage, of course) and I "Save As..." "GetTableFields.zip" and I get a working GetTableFields.zip on disk that I can unzip or whatever.

    The same steps do not produce a "working" GetTableFields.zip in UE; and I cannot figure out a sequence of steps that do work.

    Anyone?

    Thanks!



    -----------------4141397533
    Content-Type: application/ZIP;
    name="GetTableFields.zip"
    Content-Transfer-Encoding: base64
    Content-Disposition: inline;
    filename="GetTableFields.zip"

    UEsDBBQAAAAIACBm1TbvaY80hQgAABccAAASAAAAR2V0VGFibGVGaWVsZHMu
    Y2x3pVlbc9pGFH73jP/D8gIiozJgmzRph2mIwAlTQK4E9fSpI6TFqBES1cXE
    nUx+e8/eVxew664fLO2ePbc95ztnBUIIHdLkIfX2lxeXF/CGwtiPigAbnexx
    42W4B++dromS2Mc1gr13OOC0TML4wAqjRgt7sp5Pjc74btbp8jmE7CI/FPkE
    b4oHN0/D+MF4Y7GHrumM7827sWuN5+ZyvICtNeKx5DRdTtgTXWWEhrtyZstP
    6LDAWeY9YE5rpdjLsZXEMfbzMIkNUPmNpd4ZlbtLjtM0TdLM0BfRgTxzTp9w
    fhviKDhJguOAOcKyF7M4zHGK1LCaJhtGS6fce18wyooUo3yHEfgSWTZZCr0o
    zDAKM+R7UYRB7OKJq6SxapfMFCftJwGWp75FUlhvlinWgSEPTXFujxq8KciA
    1XejRBsXUaSOXnOfpNJW5VzPipIMG9pSEGYHMlXfRh0uH6jnK/qRRYh0Hwfg
    REKQ/cMXIaSE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SZ9kqAsmKsq7pbLEgww5
    9no1WxJwm4xXYyhDqmTR0bYYPV0pieYrZ4pHcNQuxEjcWUMriXRyNhsRTNBm
    WaGx3JVj3alPxPy6TRC0Mk1/dAArLHvCkZpaQr6V8/NQH753onXR87uEKmSv
    uihxO2RINW3jlxdqHL+9CPPh6qIHI/FjW4mgOhlkHwcfRdkshwzpF8aI8CE+
    MQh9pTs4zQQh6UfiJs6Smu2S/rRKzVKiR5uSkdxbpZJ8HAyRWf4JgY3JzL2z
    oX4JyhrBeDKplUQ6Traj4IOXJ3xta9YtYQD5037QQneObU0na2fa8NNWZLEe
    BvEINIaDq64KQ7k8kptgtv7zm6CjOfovUEsDBBQAAAAIACdm1TZgi8eqvAAA
    AMwBAAASAAAAR2V0VGFibGVGaWVsZHMucHJqjZE9C8JADIZ3wf9w1KUd6qAg
    Li2IRZeWirhL20tLMHdXev1Qf71ZREWhbkneJw+B+L7YQ3vKcoIdAkk7ncy0
    AYktF/ZmW1BiQL1ccKuMBBIFZQ0aLSQRz+omq1QmJORd5fYog7DsiLxXYuoW
    Fd7BLeouCJfrlfe+VaIG97xNkxj1JWH/OQiN/o1EcfwkyvIHsonSMQsjYxbb
    j0ls/8clyeH4xzFMfbkKo2okEM7nX+YFDQ7HxNavDK7A2QNQSwECFAAUAAAA
    CAAgZtU272mPNIUIAAAXHAAAEgAAAAAAAAABACAAAAAAAAAAR2V0VGFibGVG
    aWVsZHMuY2x3UEsBAhQAFAAAAAgAJ2bVNmCLx6q8AAAAzAEAABIAAAAAAAAA
    AQAgAAAAtQgAAEdldFRhYmxlRmllbGRzLnByalBLBQYAAAAAAgACAIAAAACh
    CQAAAAA=
    -----------------4141397533--

    36
    Basic UserBasic User
    36

      Jan 20, 2010#2

      I haven't tried the feature, but do you f.ex have "trim trailing spaces on save" enabled?

      If I were you I'd diff the files created and see what differences there are. It might lead you to what is wrong.

      7
      NewbieNewbie
      7

        Jan 21, 2010#3

        Good thoughts; but no dice yet.

        I checked various settings in UE; and "Trim Trailing Spaces on Save" was Off (as it should be for this I suppose).

        But, "Allow low ASCII values t be entered" was off. I changed it to on.

        "Allow editing of text files with HEX 00's without converting them to spaces" was also off. I changed it to on.

        But the same thing happens.

        Basically, UE only decodes the first 5 bytes. When I look closer at those bytes and the "working" zip in hex mode; I see that the sixth, seventh and eighth bytes happen to be 00 (null) in the working zip produced by Notepad++.

        I guess that despite my changing UE options that specify hows to handle 00's, UE's Base64 Decode is for some reason stopping the decode when it decodes a null value.

        There may be other options I still need to set correctly. But there is no help on the new Base64 Decoding that I can find, that might explain what I need to do.

        Perhaps tomorrow, if someone hasn't chimed in that knows what to do, I will email UE tech support about this.

        Thanks!

        6,603548
        Grand MasterGrand Master
        6,603548

          Re: Base64 encoding and decoding of binary data in a text file?

          Jan 21, 2010#4

          In your case you would need a working base64 decoding in hex edit mode. I think IDM has implemented the feature only for base64 encoding/decoding for text content and not for binary content. It is possible to execute command Decode Base64 also in hex edit mode, but then UltraEdit tries to decode the displayed ASCII strings instead of the real selected bytes of the file.

          I suggest to write an enhancement request email to IDM support asking for Decode Base64 and Encode Base64 working on the selected bytes of the file instead of the displayed string when hex edit mode is active for the current file to be able to encode/decode also binary data.
          Best regards from an UC/UE/UES for Windows user from Austria

          7
          NewbieNewbie
          7

            Jan 21, 2010#5

            Perhaps that is correct.

            Too bad there doesn't seem to be any real docs on exactly how it does work; forcing guesses to be made.

            I will email them today; but since I don't know positively that that is why it doesn't work I will simply supply my sample and ask them how to make it work. Then they can tell me it won't work because it is a binary decode. At that point I can feel comfortable to suggest it should work in any case (as it does in Notepad++).

            Thanks for your input!

              Feb 11, 2010#6

              I thought I'd post a follow up on this issue.

              I had an email exchange with IDM about this issue; and below is the most recent reply.

              So it is a bug, but it is going to be fixed.

              > From: IDM Computer Solutions <...>
              > To: <...>
              > Sent: Thu, February 4, 2010 8:21:08 AM
              > Subject: Re: Base64 Decode - how to make it work?
              >
              > Hello Ron,

              > Thanks for your response.  This issue has been assigned
              > for a fix, however the developer who is working on this
              > will be out of the office for a few days.  I will make sure
              > you're notified as soon as a fix is available.  I apologize
              > for the delay.
              >
              > Thanks,

                Mar 12, 2010#7

                I am pleased to report that the Base64 decoding problem I reported in this thread, has been fixed! Today I was sent a link to a 16.00.0.1030 version, and requested to test the fix in it. I have reported back to them that the problem is fixed. Hopefully that update will be released soon.

                Hooray!

                Ron