Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

SDK doesn't handle Unicode control characters.

Open
#490 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
java
Domain
api

Research direction

Start with the GetMetadataArg constructors and the DbxUserFilesRequests.getMetadata call shown in the stack trace, then trace the path pattern validation. Reproduce the unescaped U+2028 path and compare it with the escaped input; done means the Java SDK accepts the actual Unicode path and sends it to the API without treating the escape text as a literal backslash sequence.

Written by the indexing model from the issue text.

Description

bug

Basically I have a code that does this:

    private final DbxUserFilesRequests files;

    @SneakyThrows
    public Metadata getMetadata(String path) {
        return files.getMetadata(path);
    }

This works for normal paths that don't contain control characters.

However, if you supply path that contains the Unicode Control Characters that aren't escaped:

/SomeFolder/acces
s_token.txt

It spits out this issue:

 java.lang.IllegalArgumentException: String 'path' does not match pattern
    at com.dropbox.core.v2.files.GetMetadataArg.<init>(GetMetadataArg.java:58)
    at com.dropbox.core.v2.files.GetMetadataArg.<init>(GetMetadataArg.java:80)
    at com.dropbox.core.v2.files.DbxUserFilesRequests.getMetadata(DbxUserFilesRequests.java:1602)

But if you escape the path from unicode characters like this:

acces\u2028s_token.txt

It seems that the library escapes the backslash character, and causes the API to return the Malformed path response.

    "error": {
        ".tag": "path",
        "path": {
            ".tag": "malformed_path"
        }
    }

Unfortunately, I don't really have a choice in renaming the file. Is there a solution we can have to handle the unicode control? Like another method that allows us to supply a string that won't be processed by the SDK?

I know from cURL, it's possible to use the escaped form of the unicode character and get the metadata. However, it's just not a choice I have from the java SDK since it won't do it for me, and it doesn't like the escaped version of unicode.

Dominant language
Java
Stars
627
Forks
463
Avg merge
5m
Merged PRs (30d)
10

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dropbox/dropbox-sdk-java

All issues in dropbox/dropbox-sdk-java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.