Learn how to make the most out of the Dropbox Community here 💙.
Forum Discussion
seizo
8 years agoHelpful | Level 6
File name written with Multi-byte code
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. :)
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.
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. <(_ _)>
- Greg-DB
Dropbox Staff
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.
- seizoHelpful | Level 6
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. <(_ _)>
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,965 PostsLatest Activity: 5 hours ago
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 or Facebook.
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!