iOS Question [RESOLVED] DecodeBase64 Abnormal behavior

MarcoRome

Expert
Licensed User
Longtime User
Today is so.
I have this code:

B4X:
Sub JobDone(Job As HttpJob)

    If Job.Success Then
        Dim res As String
        res = Job.GetString
        Log("Response from server: " & res)
        'Log(decode(res))
        Dim strResult As String
        Dim su As StringUtils
        Dim bt() As Byte
        Dim bc As ByteConverter
        Log("Pass1: " & res)
        bt =su.DecodeBase64(res)
        Log(bt.Length)
        strResult = bc.StringFromBytes(bt, "UTF8")
        Log(strResult)

The server response in correct mode:


and as result in bt.lenght = 0 and strResult = "empty string"

but if i put in


Work. Why ???
I really do not understand

P.S. Erel i send your support also example. Thank you

Bye
Marco
 

MarcoRome

Expert
Licensed User
Longtime User
Hi Erel.
Right the first step ( res ) = 230 as Lengh, the second step ( s ) = 228.

res = res.Trim

So resolve also, DecodeBase64 / DecompressBytes

By why this ?
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…