Blueforcer Well-Known Member Licensed User Longtime User Mar 3, 2019 #1 I want to clone my B4A app to iOS. I download a json string from my server wich works fine in B4A: Code: Copy Dim j As HttpJob j.Initialize("bmplist", Me) j.PostString(link,$"{"reqType":"bmplist","filter":""}"$) j.GetRequest.SetContentType("application/json") Wait For JobDone (j As HttpJob) Log(j.GetString) but i get an error in B4i: Code: Copy Class (b4i_httpjob) instance released. Error occurred on line: 223 (HttpJob) Error decoding data as string. Stack Trace: ( CoreFoundation <redacted> + 252 libobjc.A.dylib objc_exception_throw + 56 CoreFoundation <redacted> + 0 AWTRIXER -[B4ICommon BytesToString::::] + 344 AWTRIXER -[B4IHttpResponse GetString2:] + 260 AWTRIXER -[b4i_httpjob _getstring2::] + 600 AWTRIXER -[b4i_httpjob _getstring:] + 408 AWTRIXER -[ResumableSub_iconlist_fill resume::] + 1696 CoreFoundation <redacted> + 144 CoreFoundation <redacted> + 292 AWTRIXER +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1624 AWTRIXER -[B4IShell runMethod:] + 448 AWTRIXER -[B4IShell raiseEventImpl:method:args::] + 2172 AWTRIXER -[B4IShellBI raiseEvent:event:params:] + 1580 AWTRIXER -[B4IDelegatableResumableSub resume::] + 380 AWTRIXER -[B4I checkAndRunWaitForEvent:event:params:] + 552 AWTRIXER -[B4ICommon CallSubDebug4::::] + 488 AWTRIXER -[B4ICommon CallSubDebug2::::] + 360 AWTRIXER -[b4i_httpjob _complete::] + 768 AWTRIXER -[b4i_httputils2service _completejob::::] + 1288 AWTRIXER -[b4i_httputils2service _hc_responsesuccess::] + 636 CoreFoundation <redacted> + 144 CoreFoundation <redacted> + 292 AWTRIXER +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1624 AWTRIXER -[B4IShell runMethod:] + 448 AWTRIXER -[B4IShell raiseEventImpl:method:args::] + 2172 AWTRIXER -[B4IShellBI raiseEvent:event:params:] + 1580 AWTRIXER __61-[B4IHttp URLSession:downloadTask:didFinishDownloadingToURL:]_block_invoke + 268 libdispatch.dylib <redacted> + 16 libdispatch.dylib <redacted> + 92 libdispatch.dylib <redacted> + 16 libdispatch.dylib <redacted> + 1068 CoreFoundation <redacted> + 12 CoreFoundation <redacted> + 1964 CoreFoundation CFRunLoopRunSpecific + 436 GraphicsServices GSEventRunModal + 100 UIKitCore UIApplicationMain + 212 AWTRIXER main + 124 libdyld.dylib <redacted> + 4 ) Whats the problem?
I want to clone my B4A app to iOS. I download a json string from my server wich works fine in B4A: Code: Copy Dim j As HttpJob j.Initialize("bmplist", Me) j.PostString(link,$"{"reqType":"bmplist","filter":""}"$) j.GetRequest.SetContentType("application/json") Wait For JobDone (j As HttpJob) Log(j.GetString) but i get an error in B4i: Code: Copy Class (b4i_httpjob) instance released. Error occurred on line: 223 (HttpJob) Error decoding data as string. Stack Trace: ( CoreFoundation <redacted> + 252 libobjc.A.dylib objc_exception_throw + 56 CoreFoundation <redacted> + 0 AWTRIXER -[B4ICommon BytesToString::::] + 344 AWTRIXER -[B4IHttpResponse GetString2:] + 260 AWTRIXER -[b4i_httpjob _getstring2::] + 600 AWTRIXER -[b4i_httpjob _getstring:] + 408 AWTRIXER -[ResumableSub_iconlist_fill resume::] + 1696 CoreFoundation <redacted> + 144 CoreFoundation <redacted> + 292 AWTRIXER +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1624 AWTRIXER -[B4IShell runMethod:] + 448 AWTRIXER -[B4IShell raiseEventImpl:method:args::] + 2172 AWTRIXER -[B4IShellBI raiseEvent:event:params:] + 1580 AWTRIXER -[B4IDelegatableResumableSub resume::] + 380 AWTRIXER -[B4I checkAndRunWaitForEvent:event:params:] + 552 AWTRIXER -[B4ICommon CallSubDebug4::::] + 488 AWTRIXER -[B4ICommon CallSubDebug2::::] + 360 AWTRIXER -[b4i_httpjob _complete::] + 768 AWTRIXER -[b4i_httputils2service _completejob::::] + 1288 AWTRIXER -[b4i_httputils2service _hc_responsesuccess::] + 636 CoreFoundation <redacted> + 144 CoreFoundation <redacted> + 292 AWTRIXER +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1624 AWTRIXER -[B4IShell runMethod:] + 448 AWTRIXER -[B4IShell raiseEventImpl:method:args::] + 2172 AWTRIXER -[B4IShellBI raiseEvent:event:params:] + 1580 AWTRIXER __61-[B4IHttp URLSession:downloadTask:didFinishDownloadingToURL:]_block_invoke + 268 libdispatch.dylib <redacted> + 16 libdispatch.dylib <redacted> + 92 libdispatch.dylib <redacted> + 16 libdispatch.dylib <redacted> + 1068 CoreFoundation <redacted> + 12 CoreFoundation <redacted> + 1964 CoreFoundation CFRunLoopRunSpecific + 436 GraphicsServices GSEventRunModal + 100 UIKitCore UIApplicationMain + 212 AWTRIXER main + 124 libdyld.dylib <redacted> + 4 ) Whats the problem?
Erel B4X founder Staff member Licensed User Longtime User Mar 3, 2019 #2 You should probably use Job.GetString2 and pass the correct encoding. Upvote 0
Blueforcer Well-Known Member Licensed User Longtime User Mar 3, 2019 #3 With iso-8859-1 it works, but it is UTF8 and also works with UTF8 in B4A. Whats the difference between encoding in B4A and B4i? Upvote 0
With iso-8859-1 it works, but it is UTF8 and also works with UTF8 in B4A. Whats the difference between encoding in B4A and B4i?
Erel B4X founder Staff member Licensed User Longtime User Mar 3, 2019 #4 It is not a valid UTF8 string. Otherwise it would have worked. Blueforcer said: Whats the difference between encoding in B4A and B4i? Click to expand... Android decoder is more lenient and sometimes ignores decoding errors. Upvote 0
It is not a valid UTF8 string. Otherwise it would have worked. Blueforcer said: Whats the difference between encoding in B4A and B4i? Click to expand... Android decoder is more lenient and sometimes ignores decoding errors.