AnsweredAssumed Answered

Problem when posting UTF8 using CMIS

Question asked by fgozman on Mar 26, 2010
Hi all

I try to create a folder with a name containing UTF8 chars using CMIS but is not working properly.
The folder name is "folder ățîșă" where 'ă', 'ț', 'î', 'ș', 'ă' are unicode chars. When the code is executed Alfresco make a folder "folder ățîșă" instead. I think the problem is about encoding.
I have tried also with other unicode chars and didn't worked.
I'm using the following code:

String xmlData=
                "<?xml version='1.0' encoding='utf-8'?>" +
                "<entry xmlns=''
                           xmlns:cmis=''>" +
                    "<title><![CDATA[folder ățîșă]]></title>" +                  
                    "<link rel='alternate' href=''/>"+
                    "<summary><![CDATA[folder ățîșă]]></summary>"+
                    "<cmisra:object>" +
                        "<cmis:properties>" +                          
                            "<cmis:propertyId propertyDefinitionId='cmis:objectTypeId'>"+
                             "</cmis:propertyId>" +
                        "</cmis:properties>" +
                    "</cmisra:object>" +
            HttpPost httpost =
                new HttpPost(createURI(cmisServicePath+"/s/workspace:SpacesStore/p//children"));
            StringEntity ent= new StringEntity(xmlData,"utf-8");
            ent.setContentType("application/atom+xml; type=entry; charset=utf-8;");
            HttpResponse response = httpclient.execute(httpost);

If somebody had the same problem or know how to fix let me know.

Best regards