Details

    • Steps to Reproduce:
      Hide

      Here's a few tests using the different conversion methods to
      reproduce:
      1)
      <cfset original = "test#chr(555)#this#chr(444)#string">
      <cfdump var="#original#">
      <cfset decoded = binaryDecode(original,"base64")/>
      <cfdump var="#decoded#">
      <cfset encoded = binaryEncode(decoded,"base64")/>
      <cfdump var="#encoded#">

      In Railo, this results in the value of "encoded"
      being set to "test+thisstring=". In ACF I get an error
      "The input and output encodings are not same."
      -------------------------------------------------------------------------------------
      2)
      <cfset original = "test#chr(555)#this#chr(444)#string">
      <cfdump var="#original#">
      <cfset decoded = toBinary(toBase64(original,"utf-8"))/>
      <cfdump var="#decoded#">
      <cfset encoded = toString(decoded,"utf-8")/>
      <cfdump var="#encoded#">

      In Railo, this results in the value of "encoded"
      being set to "test?this?string". In ACF "encoded"
      is exactly the same as "original"
      -------------------------------------------------------------------------------------
      3)
      <cfset original = "test#chr(555)#this#chr(444)#string">
      <cfdump var="#original#">
      <cfset decoded = charsetDecode(original,"utf-8")/>
      <cfdump var="#decoded#">
      <cfset encoded = charsetEncode(decoded,"utf-8")/>
      <cfdump var="#encoded#">

      This one works correctly in both Railo and ACF
      -------------------------------------------------------------------------------------

      Show
      Here's a few tests using the different conversion methods to reproduce: 1) <cfset original = "test#chr(555)#this#chr(444)#string"> <cfdump var="#original#"> <cfset decoded = binaryDecode(original,"base64")/> <cfdump var="#decoded#"> <cfset encoded = binaryEncode(decoded,"base64")/> <cfdump var="#encoded#"> In Railo, this results in the value of "encoded" being set to "test+thisstring=". In ACF I get an error "The input and output encodings are not same." ------------------------------------------------------------------------------------- 2) <cfset original = "test#chr(555)#this#chr(444)#string"> <cfdump var="#original#"> <cfset decoded = toBinary(toBase64(original,"utf-8"))/> <cfdump var="#decoded#"> <cfset encoded = toString(decoded,"utf-8")/> <cfdump var="#encoded#"> In Railo, this results in the value of "encoded" being set to "test?this?string". In ACF "encoded" is exactly the same as "original" ------------------------------------------------------------------------------------- 3) <cfset original = "test#chr(555)#this#chr(444)#string"> <cfdump var="#original#"> <cfset decoded = charsetDecode(original,"utf-8")/> <cfdump var="#decoded#"> <cfset encoded = charsetEncode(decoded,"utf-8")/> <cfdump var="#encoded#"> This one works correctly in both Railo and ACF -------------------------------------------------------------------------------------
    • Workaround:
      Workaround Exists
    • Workaround Description:
      Hide

      Use charsetEncode()/charsetDecode()

      Show
      Use charsetEncode()/charsetDecode()

      Description

      Binary decoding/encoding a string with non-printable characters (i.e. chr(555)) using binaryDecode(str,"base64")/binaryEncode(bin,"base64") or toBinary()/toString() results in these special characters being replaced. When converting a string to binary, then back to string the resulting string should be exactly the same as the original.

      Adobe CF9 converts properly using toBinary() and charsetEncode() while it breaks when using binaryDecode() with an error: "The input and output encodings are not same."

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                micstriit Michael Offner
                Reporter:
                aadams Abram Adams
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: