<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Umlauts in file names in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Umlauts-in-file-names/m-p/208623#M10308</link>
    <description>&lt;P&gt;For these calls with the parameters in the header, you need to escape these characters. That is, when you use the “Dropbox-API-Arg” header, you need to make it “HTTP header safe”. This means using JSON-style “\uXXXX” escape codes for the character 0x7F and all non-ASCII characters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Some, but not all, languages/libraries do this for you. For example, for JavaScript, to&amp;nbsp;do this yourself you could do something like this:&lt;/P&gt;
&lt;PRE&gt;var charsToEncode = /[\u007f-\uffff]/g;&lt;BR /&gt;function http_header_safe_json(v) {&lt;BR /&gt; return JSON.stringify(v).replace(charsToEncode,&lt;BR /&gt; function(c) { &lt;BR /&gt; return '\\u'+('000'+c.charCodeAt(0).toString(16)).slice(-4);&lt;BR /&gt; }&lt;BR /&gt; );&lt;BR /&gt;}&lt;/PRE&gt;
&lt;P&gt;and then:&lt;/P&gt;
&lt;PRE&gt;"Dropbox-API-Arg": http_header_safe_json(arg)&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 26 Feb 2017 18:48:57 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2017-02-26T18:48:57Z</dc:date>
    <item>
      <title>Umlauts in file names</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Umlauts-in-file-names/m-p/208470#M10297</link>
      <description>&lt;P&gt;Hi, I am using the v2 API for http. What I found is that if a file or folder name contains a special character, like a German Umlaut like ä, I get a 400 error on upload and download. Is this a bug?&amp;nbsp;&lt;/P&gt;&lt;P&gt;During download the response text is "Error in call to API function "files/download": HTTP header "Dropbox-API-Arg": could not decode input as JSON".&lt;/P&gt;&lt;P&gt;During upload the response text is "Error in call to API function "files/upload": HTTP header "Dropbox-API-Arg": could not decode input as JSON".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Seems like there's a bug in the JSON.parse() function on DropBox's side. The same JSON stringified text with an umlaut in the file name will parse just fine in the browsers I tested.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:25:27 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Umlauts-in-file-names/m-p/208470#M10297</guid>
      <dc:creator>Klaus A.</dc:creator>
      <dc:date>2019-05-29T09:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: Umlauts in file names</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Umlauts-in-file-names/m-p/208623#M10308</link>
      <description>&lt;P&gt;For these calls with the parameters in the header, you need to escape these characters. That is, when you use the “Dropbox-API-Arg” header, you need to make it “HTTP header safe”. This means using JSON-style “\uXXXX” escape codes for the character 0x7F and all non-ASCII characters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Some, but not all, languages/libraries do this for you. For example, for JavaScript, to&amp;nbsp;do this yourself you could do something like this:&lt;/P&gt;
&lt;PRE&gt;var charsToEncode = /[\u007f-\uffff]/g;&lt;BR /&gt;function http_header_safe_json(v) {&lt;BR /&gt; return JSON.stringify(v).replace(charsToEncode,&lt;BR /&gt; function(c) { &lt;BR /&gt; return '\\u'+('000'+c.charCodeAt(0).toString(16)).slice(-4);&lt;BR /&gt; }&lt;BR /&gt; );&lt;BR /&gt;}&lt;/PRE&gt;
&lt;P&gt;and then:&lt;/P&gt;
&lt;PRE&gt;"Dropbox-API-Arg": http_header_safe_json(arg)&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Feb 2017 18:48:57 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Umlauts-in-file-names/m-p/208623#M10308</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-02-26T18:48:57Z</dc:date>
    </item>
    <item>
      <title>Re: Umlauts in file names</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Umlauts-in-file-names/m-p/208627#M10309</link>
      <description>&lt;P&gt;Thanks Greg, that worked. And thanks for answering on a sunday too.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Feb 2017 20:18:05 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Umlauts-in-file-names/m-p/208627#M10309</guid>
      <dc:creator>Klaus A.</dc:creator>
      <dc:date>2017-02-26T20:18:05Z</dc:date>
    </item>
    <item>
      <title>Re: Umlauts in file names</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Umlauts-in-file-names/m-p/212851#M10807</link>
      <description>Hi Klaus&lt;BR /&gt;I have the same problem with a .net application.&lt;BR /&gt;I tried differend solutions to change the "Ä" in my path, but it will not work.&lt;BR /&gt;Do you have a tip for a dropbox newcommer? How have you solved the exception&lt;BR /&gt;My (notworking) path with umlaut looks like this:&lt;BR /&gt;{"path": "/Bild mit Umlaut/Ä Wasser.jpg","format": "jpeg","size": "w128h128"}&lt;BR /&gt;Best regards Horst</description>
      <pubDate>Wed, 22 Mar 2017 16:07:18 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Umlauts-in-file-names/m-p/212851#M10807</guid>
      <dc:creator>developer_net</dc:creator>
      <dc:date>2017-03-22T16:07:18Z</dc:date>
    </item>
    <item>
      <title>Re: Umlauts in file names</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Umlauts-in-file-names/m-p/212856#M10808</link>
      <description>&lt;P&gt;I got a solution from Dropbox support that works. You need to escape all non-ASCII characters 'JSON' style. Which means all characters with character codes &amp;gt; 0x7F have to be replaced by a 4-digit hex code (it's hex unicode), preceeded by '\u'. For example&amp;nbsp;&lt;SPAN&gt;Ä would be replaced with \u00c4 in the file name string.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Replacing parts of a string is very straightforward in Javascript, but a little more involved in a language like C.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Mar 2017 16:43:35 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Umlauts-in-file-names/m-p/212856#M10808</guid>
      <dc:creator>Klaus A.</dc:creator>
      <dc:date>2017-03-22T16:43:35Z</dc:date>
    </item>
    <item>
      <title>Re: Umlauts in file names</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Umlauts-in-file-names/m-p/212879#M10809</link>
      <description>&lt;P&gt;For example, in C#, using Json.NET/JsonTextWriter, that would look like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;var sb = new StringBuilder(); 
var textWriter = new JsonTextWriter(new StringWriter(sb)); 
textWriter.StringEscapeHandling = StringEscapeHandling.EscapeNonAscii; 

// Write things to text writer 
textWriter.WriteStartArray(); 
textWriter.WriteValue("Hello");

... 

var result = sb.toString().Replace("\x7f", "\\u007f");&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or, using Json.NET/JsonConvert:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;var serializerSettings = new JsonSerializerSettings(); 
serializerSettings.StringEscapeHandling = StringEscapeHandling.EscapeNonAscii; 

var result = JsonConvert.SerializeObject(..., serializerSettings); 
result = result.Replace("\x7f", "\\u007f");
&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Mar 2017 17:37:08 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Umlauts-in-file-names/m-p/212879#M10809</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-03-22T17:37:08Z</dc:date>
    </item>
    <item>
      <title>Re: Umlauts in file names</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Umlauts-in-file-names/m-p/212983#M10814</link>
      <description>Thank you Klaus!&lt;BR /&gt;Upgrading vom Json.net 4.5 to 10 and using the StringEscapeHandling.EscapeNonAscii solves my problem &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@41457EF40051AFF130FDBFE21B496926/emoticons/1f609.png" alt=":winking_face:" title=":winking_face:" /&gt;&lt;BR /&gt;Best regards, Horst</description>
      <pubDate>Thu, 23 Mar 2017 11:07:31 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Umlauts-in-file-names/m-p/212983#M10814</guid>
      <dc:creator>developer_net</dc:creator>
      <dc:date>2017-03-23T11:07:31Z</dc:date>
    </item>
    <item>
      <title>Re: Umlauts in file names</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Umlauts-in-file-names/m-p/231552#M12623</link>
      <description>&lt;P&gt;My file path is saved in a c++ std::string.&amp;nbsp;Can you please provide&amp;nbsp;code to do that character skipping&amp;nbsp;in C++? Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2017 23:26:27 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Umlauts-in-file-names/m-p/231552#M12623</guid>
      <dc:creator>mi2</dc:creator>
      <dc:date>2017-07-10T23:26:27Z</dc:date>
    </item>
    <item>
      <title>Re: Umlauts in file names</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Umlauts-in-file-names/m-p/231662#M12629</link>
      <description>&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/437075"&gt;@mi2&lt;/a&gt;&amp;nbsp;I unfortunately don't have a sample for C++. Please refer to my C# samples above and translate them for your platform.&lt;/P&gt;</description>
      <pubDate>Fri, 31 Aug 2018 13:51:04 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Umlauts-in-file-names/m-p/231662#M12629</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2018-08-31T13:51:04Z</dc:date>
    </item>
    <item>
      <title>Re: Umlauts in file names</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Umlauts-in-file-names/m-p/294917#M17937</link>
      <description>&lt;P&gt;Is there any way to do this in java?&lt;/P&gt;</description>
      <pubDate>Fri, 31 Aug 2018 09:02:57 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Umlauts-in-file-names/m-p/294917#M17937</guid>
      <dc:creator>Abhishek3881000</dc:creator>
      <dc:date>2018-08-31T09:02:57Z</dc:date>
    </item>
    <item>
      <title>Re: Umlauts in file names</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Umlauts-in-file-names/m-p/294918#M17938</link>
      <description>&lt;P&gt;Is there any way to do the same in java.&amp;nbsp;&lt;/P&gt;&lt;P&gt;My folder name "Å,å,Æ,æ,Ø,ø"&amp;nbsp; would be replaced with&amp;nbsp; what string?&lt;/P&gt;&lt;P&gt;I would appreciate any reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Aug 2018 09:17:34 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Umlauts-in-file-names/m-p/294918#M17938</guid>
      <dc:creator>Abhishek3881000</dc:creator>
      <dc:date>2018-08-31T09:17:34Z</dc:date>
    </item>
    <item>
      <title>Re: Umlauts in file names</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Umlauts-in-file-names/m-p/294947#M17940</link>
      <description>&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/772368"&gt;@Abhishek3881000&lt;/a&gt;&amp;nbsp;Here's an example of how you might do this&amp;nbsp;in Java, using Jackson:&lt;/P&gt;
&lt;PRE&gt;JsonFactory f = ...
JsonGenerator g = f.createGenerator(...);
g.setHighestNonEscapedChar(0x7E);&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Aug 2018 17:24:29 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Umlauts-in-file-names/m-p/294947#M17940</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2018-08-31T17:24:29Z</dc:date>
    </item>
  </channel>
</rss>

