Skip to main content

None of the calls to the ENCODE function returns the same base64 string as several online sources do.  What am I missing?

001: CRT "DATA ":;INPUT DAT
002: IF DAT = "" THEN STOP
003: RESULT=""
004: ERES = ENCODE("URLENCODE",1,DAT,1,RESULT,1)
005: CRT "RES :":ERES
006: CRT "BASE64 RESULT: ":RESULT
007: RESULT=""
008: ERES = ENCODE("SSL_BASE64",1,DAT,1,RESULT,1)
009: CRT "RES :":ERES
010: CRT "BASE64 RESULT: ":RESULT
011: RESULT=""
012: ERES = ENCODE("SSL_BASE64_ONELINE",1,DAT,1,RESULT,1)
013: CRT "RES :":ERES
014: CRT "BASE64 RESULT:":RESULT

The results:

DATA ?Man
RES :0
BASE64 RESULT: Man
RES :1
BASE64 RESULT:
RES :1
BASE64 RESULT:



------------------------------
[Gary] [Rhodes]
[Universe Developer]
[NPW Companies]
[Hialeah] [FL] [USA]
------------------------------

None of the calls to the ENCODE function returns the same base64 string as several online sources do.  What am I missing?

001: CRT "DATA ":;INPUT DAT
002: IF DAT = "" THEN STOP
003: RESULT=""
004: ERES = ENCODE("URLENCODE",1,DAT,1,RESULT,1)
005: CRT "RES :":ERES
006: CRT "BASE64 RESULT: ":RESULT
007: RESULT=""
008: ERES = ENCODE("SSL_BASE64",1,DAT,1,RESULT,1)
009: CRT "RES :":ERES
010: CRT "BASE64 RESULT: ":RESULT
011: RESULT=""
012: ERES = ENCODE("SSL_BASE64_ONELINE",1,DAT,1,RESULT,1)
013: CRT "RES :":ERES
014: CRT "BASE64 RESULT:":RESULT

The results:

DATA ?Man
RES :0
BASE64 RESULT: Man
RES :1
BASE64 RESULT:
RES :1
BASE64 RESULT:



------------------------------
[Gary] [Rhodes]
[Universe Developer]
[NPW Companies]
[Hialeah] [FL] [USA]
------------------------------

Hi Gary,

The valid arguments to ENCODE are BASE64, BASE64A, and URLENCODE.  The RESULT value of 1 on the 2nd and 3rd ENCODE calls indicate an invalid algorithm has been supplied. The UniVerse documentation indicates that BASE64 maps to SSL_BASE64 and BASE64A maps to SSL_BASE64_ONELINE.

Thanks,

Neil



------------------------------
Neil Morris
Universe Advanced Technical Support
Rocket Software
------------------------------

Hi Gary,

The valid arguments to ENCODE are BASE64, BASE64A, and URLENCODE.  The RESULT value of 1 on the 2nd and 3rd ENCODE calls indicate an invalid algorithm has been supplied. The UniVerse documentation indicates that BASE64 maps to SSL_BASE64 and BASE64A maps to SSL_BASE64_ONELINE.

Thanks,

Neil



------------------------------
Neil Morris
Universe Advanced Technical Support
Rocket Software
------------------------------

Thank you Neil. I got a newer copy of the documentation and you are correct and it works.  Thank you!

001: CRT "DATA ":;INPUT DAT
002: IF DAT = "" THEN STOP
003: RESULT=""
004: ERES = ENCODE("URLENCODE",1,DAT,1,RESULT,1)
005: CRT "RES :":ERES
006: CRT "BASE64 RESULT: ":RESULT
007: RESULT=""
008: ERES = ENCODE("BASE64",1,DAT,1,RESULT,1)
009: CRT "RES :":ERES
010: CRT "BASE64 RESULT: ":RESULT
011: RESULT=""
012: ERES = ENCODE("BASE64A",1,DAT,1,RESULT,1)
013: CRT "RES :":ERES
014: CRT "BASE64 RESULT:":RESULT



------------------------------
[Gary] [Rhodes]
[Universe Developer]
[NPW Companies]
[Hialeah] [FL] [USA]
------------------------------

Thank you Neil. I got a newer copy of the documentation and you are correct and it works.  Thank you!

001: CRT "DATA ":;INPUT DAT
002: IF DAT = "" THEN STOP
003: RESULT=""
004: ERES = ENCODE("URLENCODE",1,DAT,1,RESULT,1)
005: CRT "RES :":ERES
006: CRT "BASE64 RESULT: ":RESULT
007: RESULT=""
008: ERES = ENCODE("BASE64",1,DAT,1,RESULT,1)
009: CRT "RES :":ERES
010: CRT "BASE64 RESULT: ":RESULT
011: RESULT=""
012: ERES = ENCODE("BASE64A",1,DAT,1,RESULT,1)
013: CRT "RES :":ERES
014: CRT "BASE64 RESULT:":RESULT



------------------------------
[Gary] [Rhodes]
[Universe Developer]
[NPW Companies]
[Hialeah] [FL] [USA]
------------------------------

Thanks for the update Gary. Happy it is now working! Thanks. Neil



------------------------------
Neil Morris
Universe Advanced Technical Support
Rocket Software
------------------------------