× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I am doing a test to see of I can convert a character string
to B64 from within an RPG program

There are programs on the web that convert files in the IFS,
but I need to convert a database field



So I am using a B64 encode/decode program from Scott Klement
(Thanks Scott)

However I am getting a completely different value then what
I get using a Web based B64 encode decode program

AND when I try to convert it back it does not convert back
correctly



Can anyone point me to what I may be doing wrong?

Does the encode.decode expect ASCII characters?

Should the example below work fine?



W$Before = 'ABCDEFGH';



W$AfterLen = B64_Encode( %ADDR(W$Before)

: %LEN(%TRIMR(W$Before))

: %ADDR(W$After)

: %SIZE(W$After) );



(Using Debug I see that W$AFTER = 'wsLDxcXGxMgg')

(Web based encodes to QUJDREVGR0gNCg==)



W$AfterLen2 = B64_Decode( %ADDR(W$After)

: %LEN(%TRIMR(W$After))

: %ADDR(W$After2)

: %SIZE(W$After2) );





(Using Debug I see that decodes back to W$AFTER2 =
'BBCEEFDH- ')



Any ideas on what I might be doing wrong?



Thanks



John






As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.