AnsweredAssumed Answered

Problem with POST UTF-8 content

Question asked by fgozman on Feb 3, 2010
Hi all

I have tried to create a folder with a name containing Unicode characters using Apache's HttpClient:

          
 
String xmlData=
                "<?xml version='1.0' encoding='utf-8'?>" +
                "<entry xmlns='http://www.w3.org/2005/Atom' xmlns:cmisra='http://docs.oasis-open.org/ns/cmis/restatom/200908/' xmlns:cmis='http://docs.oasis-open.org/ns/cmis/core/200908/'>" +
                    "<title><![CDATA[" + folderName +"]]></title>" +                   
                    "<author><![CDATA[Al Brown ățîșă]]></author>"+
                    "<link rel='alternate' href=''/>"+
                    "<summary><![CDATA[" + folderName +"ățîșă]]></summary>"+
                    "<cmisra:object>" +
                        "<cmis:properties>" +                           
                            "<cmis:propertyId propertyDefinitionId='cmis:objectTypeId'>"+
                                "<cmis:value>cmis:folder</cmis:value>"+
                             "</cmis:propertyId>" +
                        "</cmis:properties>" +
                    "</cmisra:object>" +
                "</entry>";
            HttpPost httpost =
                new HttpPost(createURI(cmisServicePath+"/s/workspace:SpacesStore/p"+(path==null?"/":path)+"/children"));
            StringEntity ent= new StringEntity(xmlData,"utf-8");
            ent.setContentType("application/atom+xml; type=entry; charset=utf-8;");
            httpost.setEntity(ent);
            HttpResponse response = httpclient.execute(httpost);
            showResponse(response);   
            httpost.abort();

The problem is that in Alfresco I will see "folder1ățîșă" instead of "folder1ățîșă".
In Aflfresco it is possible to edit using Unicode chars.

How to post Unicode chars using CMIS ?

Best regards
Florian

Outcomes