We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
Artem K.
10 years agoNew member | Level 1
International characters in filenames
Hi,
I am migrating to V2 of REST API and I am having problems with endpoints that require passing arguments using "Dropbox-API-Arg" header (for example, https://content.dropboxapi.com/2/files/downl...
Greg-DB
Dropbox Community Moderator
9 years agoThis may depend on your setup, but are you sure you need the double '/'? Have you tried it without it? i.e.,
"Dropbox-API-Arg: {"path":"/blackdog/\u4e2d\u6587prd.docx"}"
In any case, we recommend either using the official Dropbox Java SDK, or having a library do the encoding for you. E.g., for Java, using Jackson, it would look like:
JsonFactory f = ... JsonGenerator g = f.createGenerator(...); g.setHighestNonEscapedChar(0x7E);
jianwen
9 years agoExplorer | Level 3
Actually i use Jackson format json as follow:
String path = "/blackdog/中文PRD.docx";
path = StringEscapeUtils.escapeJava(path);
path_req.setPath(path);
String header_json = JsonUtils.writeValue(path_req);
LoggerUtils.logInfo(this.getClass(), header_json);
In java double / standards /,so following code
"Dropbox-API-Arg: {"path":"/blackdog/\u4e2d\u6587prd.docx"}"
is correct in Java.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!