Note that there are some explanatory texts on larger screens.

plurals
  1. POHandling non ASCII characters with principals in CQ5 REST interface
    text
    copied!<p>We are managing CQ5 groups using the REST interface. To add a user we do</p> <pre><code>POST http://$host:$port/home/groups/t/test_group.rw.html Content-Type: application/x-www-form-urlencoded addMembers:my_principal_name </code></pre> <p>which works as expected as long as the the name contains ASCII characters only.</p> <p>We tried to use latin 1 (ISO-8859-1). For example for a principal name <code>ü</code>:</p> <pre><code>POST http://$host:$port/home/groups/t/test_group.rw.html Content-Type: application/x-www-form-urlencoded addMembers:%FC </code></pre> <p>In this case no error is generated but the principal is not added.</p> <p>Our workaround is to use UTF-8 and URL-encode it <strong>twice</strong>. <code>ü</code> is <code>C3BC</code>, URL-encoded it becomes <code>%C3%BC</code> and encoded another time <code>%25C3%25BC</code></p> <p>Summarizing, to add a member <code>ü</code> we have to submit</p> <pre><code>POST http://$host:$port/home/groups/t/test_group.rw.html Content-Type: application/x-www-form-urlencoded addMembers:%25C3%25BC </code></pre> <p>which works as expected.</p> <p>Is this a bug or the API really requires to send UTF-8-encoded strings URL encoded twice?</p> <p><strong>Edit</strong> I tried with the additional <code>_charset_</code> parameter</p> <pre><code>telnet ******** 8000 Trying ********... Connected to ********. Escape character is '^]'. POST /home/groups/nethz/lz/06065.rw.html HTTP/1.1 Host: *********:8000 Content-Type: application/x-www-form-urlencoded Cache-Control: no-cache Authorization: Basic ****************= _charset_=UTF-8&amp;addMembers=aaaa_testgr%C3%BCppli HTTP/1.1 200 OK Connection: Keep-Alive Server: Day-Servlet-Engine/4.1.44 Content-Type: text/html;charset=UTF-8 Date: Fri, 04 Oct 2013 10:50:19 GMT Transfer-Encoding: chunked 4f6 &lt;html&gt; &lt;head&gt; &lt;title&gt;Content modified /home/groups/nethz/lz/06065&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;h1&gt;Content modified /home/groups/nethz/lz/06065&lt;/h1&gt; &lt;table&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt;Status&lt;/td&gt; &lt;td&gt;&lt;div id="Status"&gt;200&lt;/div&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Message&lt;/td&gt; &lt;td&gt;&lt;div id="Message"&gt;OK&lt;/div&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Location&lt;/td&gt; &lt;td&gt;&lt;a href="" id="Location"&gt;&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Parent Location&lt;/td&gt; &lt;td&gt;&lt;a href="" id="ParentLocation"&gt;&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Path&lt;/td&gt; &lt;td&gt;&lt;div id="Path"&gt;/home/groups/nethz/lz/06065&lt;/div&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Referer&lt;/td&gt; &lt;td&gt;&lt;a href="" id="Referer"&gt;&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;ChangeLog&lt;/td&gt; &lt;td&gt;&lt;div id="ChangeLog"&gt;&amp;lt;pre&amp;gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;p&gt;&lt;a href=""&gt;Go Back&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;a href=""&gt;Modified Resource&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;a href=""&gt;Parent of Modified Resource&lt;/a&gt;&lt;/p&gt; &lt;/body&gt; &lt;/html&gt; 0 Connection closed by foreign host. </code></pre> <p>We are getting a status 200 answer, but the subgroup <code>aaaa_testgrüppli</code> (<code>aaa_testgr%C3%BCppli</code>) is not inserted in <code>/home/groups/nethz/lz/06065</code></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload