Forums
Hi,
I'm trying to use base64encodestr() but am not getting the response I'm expecting.
If I use the string:
"This is a base64 encoded string"
I would expect:
VGhpcyBpcyBhIGJhc2U2NCBlbmNvZGVkIHN0cmluZw==
IceBreak gives something like:
îåÇøÄ`âøÄ`âÇñå$ÇÄ í +äâ%Â_+Î!åî,ñç+ Ä_%Í!Ï
I've tried adding xlateStr( myStr : 0 : 1252 ) but this still does not help.
What am I missing?
Regards,
David
Re: IceBreak base64encodestr()
Hi David,
No wonder you are in limbo!! The base64encodeStr always returns an ascii string. This is due to the implementation of the binary values in the base64 format which is always in ascii. So you need to convert the input to ascii and then result back to EBCDIC after you have decoded it.
In that case you will have the same base64String as if you did the conversion on a website like http://www.motobit.com/util/base64-decoder-encoder.asp presumably running 100% ASCII.
Your RPGcode has to look like:
Best regards,
Niels Liisberg
Re: IceBreak base64encodestr()
Niels,
It works.
Many thanks,
David.