cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
What’s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and more here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

File name written with Multi-byte code

File name written with Multi-byte code

seizo
Helpful | Level 6
Go to solution

At first, this writing contains multi-byte charactors.
So, you might unable to read some charactors correctly.


Let's see.
I'm trying to get the file-list from my Dropbox using Dropbox API.
The endpoint that I use is .....
https://api.dropboxapi.com/2/files/list_folder

And there are two files in my Dropbox.
They are ....
----------------------
u3042u3044u3046.txt
あいう.txt
----------------------
(The second one contains multi-byte charactors.)


On this condition, the JASON that I've got from the API is this below.
-----------------------------------------
{
id : id:********111,
name : u3042u3044u3046.txt,
path_lower : /u3042u3044u3046.txt ,
path_display : /u3042u3044u3046.txt ,
............
},
{
id : id:********222,
name : u3042u3044u3046.txt,
path_lower : /u3042u3044u3046.txt ,
path_display : /u3042u3044u3046.txt ,
............
},
-----------------------------------------
(the data is the same except for "id".)

 

So my question is .....
"How can I distinguish these two files?"


I think the API seems to convert every multi-byte charactor to "u????" style.
If so, it is difficult to distinguish two files like them above.

Does anyone have solutions?
I need help. 🙂

2 Accepted Solutions

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

How are you printing this output? The API itself should be be returning valid escaped unicode characters where applicable. I just tried it myself using the filenames you supplied, and I'm seeing these pieces of raw output, for the respective file names (using curl):

 

"name": "u3042u3044u3046.txt"
"name": "\u3042\u3044\u3046.txt"

The first one is the plain text file name, and the second is the encoded unicode file name.

View solution in original post

seizo
Helpful | Level 6
Go to solution

I've found a wrong process in my program.
The process has been removing escape codes "\" from the data.

I appreciate you for the kind advice.   <(_ _)>

View solution in original post

2 Replies 2

Greg-DB
Dropbox Staff
Go to solution

How are you printing this output? The API itself should be be returning valid escaped unicode characters where applicable. I just tried it myself using the filenames you supplied, and I'm seeing these pieces of raw output, for the respective file names (using curl):

 

"name": "u3042u3044u3046.txt"
"name": "\u3042\u3044\u3046.txt"

The first one is the plain text file name, and the second is the encoded unicode file name.

seizo
Helpful | Level 6
Go to solution

I've found a wrong process in my program.
The process has been removing escape codes "\" from the data.

I appreciate you for the kind advice.   <(_ _)>

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    seizo Helpful | Level 6
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?