How does nativescript-background-http support unicode filename?


#1

nativescript-background-http: 3.1.0

When upload a file with unicode name, let’s say Chinese, the filename that server gets is like ???.pdf.

  • the filename is correct just right before upload.
  • By using @angular/common/http with regular Angular Web App, the same scenario, it worked perfectly.

Is anyone facing the same issue here? Thanks.


#2

My solution is:
Use the btoa() function to encode
btoa('filename1')

Use the atob() function to decode.
atob('cGFzc3dvcmQ=')

I am not sure if this is the best way I need to go.


Looks like it doesn’t work since I cannot change the filename to base64 before uploading.

Any suggestion?


#3

Final solution:
Since the file can be sent to server, we just need to rename the file with something like timestamp string, this also must be done to avoid duplicate file name.

Closed