Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filename encoding #5686

Closed
maksimyugai opened this issue Oct 29, 2018 · 4 comments
Closed

Filename encoding #5686

maksimyugai opened this issue Oct 29, 2018 · 4 comments
Labels
kind/support A question or request for support

Comments

@maksimyugai
Copy link

maksimyugai commented Oct 29, 2018

Hi, guys.

Faced with encoding problem.
I use java-ipfs-api for my project and when I upload a file with Russian (for example) filename I get json response with wrong filename encoding.

There's an issue in Java IPFS repo: ipfs-shipyard/java-ipfs-http-client#76.

If upload wth cli - there's no problem.

Any ideas why it happens?

https://ipfs.io/ipfs/QmQzsXRNVT44TiqhK6sszm5WKb5eKH917jL8Jdhaxqvduu

image

@Stebalien
Copy link
Member

Stebalien commented Oct 29, 2018

Not sure but try setting the filename with file.getName().getBytes("utf-8"). Also, try printing the file in Java before sending it to make sure you're getting the right result.

@Stebalien Stebalien added the kind/support A question or request for support label Oct 29, 2018
@qiwaa
Copy link
Contributor

qiwaa commented Oct 30, 2018

I have encountered a similar problem and have solved it.
I hope this will give you some help.

ipfs-shipyard/java-ipfs-http-client#111

@maksimyugai
Copy link
Author

maksimyugai commented Nov 2, 2018

Not sure but try setting the filename with file.getName().getBytes("utf-8"). Also, try printing the file in Java before sending it to make sure you're getting the right result.

No, it's not helping.

I have encountered a similar problem and have solved it.
I hope this will give you some help.

ipfs/java-ipfs-api#111

Thank you, I'll see

@maksimyugai
Copy link
Author

maksimyugai commented Nov 13, 2018

Resolved issue by using HttpMultipartMode.RFC6532

MultipartEntityBuilder builder = MultipartEntityBuilder.create().setMode(HttpMultipartMode.RFC6532)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/support A question or request for support
Projects
None yet
Development

No branches or pull requests

3 participants