|
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 mailing list archive is Copyright 1997-2025 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.