-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Android utf-8 coding #122
Comments
Hi @windhost , could you let me know what's the |
|
Thank you for your update, but I also can't get a blob. This is in iOS
|
@windhost , thanks for the detailed information that's really helpful, basically our network module will try to decode response data as UTF8 string, if it failed, encode the data using BASE64 encoding. Looks like this process success on Android but failed on IOS, as such it result in inconsistent behavior. To solve this problem, I'm planning to add an extra option to RNFetchBlob.fetch('GET', 'http://example.com/myblob',
{
// extra header
'RNFB-Response' : 'base64'
})
.then((res) => {
res.base64()
}) I'll update the status in this thread once it's done 😄 |
You have solved this problems, that help me a lot. Thank you a thousand! I'm waiting for your update. |
@windhost , I've published RNFetchBlob.fetch('GET', 'http://example.com/myblob',
{
// extra header
'RNFB-Response' : 'base64'
})
.then((res) => {
res.text() // should be base64 encoded string
}) Please try upgrade to this version, see if it solves the problem, thank you 😄 |
OK, I will do this. |
It works on android. Thank you for you reply! |
Great ! 👍 Nice to know it works 😄 |
Wanted to include a note for folks upgrading from the old branch to the new branch about renaming all product references as this was a problem I came across in wkh237#122 (joltup#122)
The js communicates with android native use utf-8 code, when I request a binary text from server, the response type is not blob, it coded to utf-8 string. And iOS use base64 code, it works well.
The text was updated successfully, but these errors were encountered: