fixed an upload issue when file name contains arabic/persian numbers #563
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey man,
great library, i've been using it for some time and it made my life much easier :D
there was a tricky issue with file uploads, when there are arabic/persian numbers in file name (or maybe also some other languages)
the library wont upload the file as was stated in this issue](#491)
the thing that makes it extra tricky is the fact that you can have an image in your phone with the name "image123.png" when you upload the image on (EN) locale everything is fine, but if you change the Locale to Persian (FA), getting the file URI/name from android will return then name with Persian numbers, and even if you try to fetch the "image123.png" it cant find it, you need to use the name with pesian number :D, pretty weird ;D
the root of the problem was the fact that, okhttp header will not accept these numbers as valid characters for the header, i worked around it by URL Encoding the name and adding a new method that has an extra encoding parameter when making Multipart files.
it can probably be done in a cleaner way, ill leave that to you
Have a nice day.