Re: Trouble Decoding Base64 Text

2018-06-30 Thread Bernd Fröhlich via 4D_Tech
Dave Nasralla: > Nevermind, though I'm not entirely sure this isn't a kind of bug. > If you change the Encoding by adding two equal signs to the end > "eyJ1c2VySWQiOiJiMDhmODZhZi0zNWRhLTQ4ZjItOGZhYi1jZWYzOTA0NjYwYmQifQ==" > > It properly decodes to: >

Re: Trouble Decoding Base64 Text

2018-06-29 Thread Bruno LEGAY via 4D_Tech
Hi, Base64 encoded data has a length which is multiple of 4. If not, it should be padded with "=" (1 to 3 "=") Your data is not strict base64 as it does not follow this. Looks like 4D does not like when it is not padded. // pad with "=" to make text a multiple of 4 C_LONGINT($vl_padModulo)

Re: Trouble Decoding Base64 Text

2018-06-29 Thread Dave Nasralla via 4D_Tech
Nevermind, though I'm not entirely sure this isn't a kind of bug. If you change the Encoding by adding two equal signs to the end "eyJ1c2VySWQiOiJiMDhmODZhZi0zNWRhLTQ4ZjItOGZhYi1jZWYzOTA0NjYwYmQifQ==" It properly decodes to: {"userId":"b08f86af-35da-48f2-8fab-cef3904660bd"} Some online decoding

Trouble Decoding Base64 Text

2018-06-29 Thread Dave Nasralla via 4D_Tech
Can anyone tell me what I am doing wrong here. In the code below I am getting back the same text I and trying to decode. C_BLOB($Blob_vx) C_TEXT($EncodedText_vt) $EncodedText_vt:="eyJ1c2VySWQiOiJiMDhmODZhZi0zNWRhLTQ4ZjItOGZhYi1jZWYzOTA0NjYwYmQifQ" TEXT TO BLOB($EncodedText_vt;$Blob_vx;UTF8 text