Thursday, 10 April 2014

Posting Special Characters to Adobe Experience Manager

In some some business use cases, you may have to post special characters, such as ®, to Adobe Experience Manager. Once posted to AEM, you can use special characters to set node properties, as shown in the following illustration.

By default, you cannot post strings to AEM that contain special characters. For example, you cannot run this CURL command to post special characters to AEM.

curl -H "charset=utf-8" -u admin:admin -X POST --data "test=€ , Š , Œ , ™ , š , œ , ž" http://localhost:4502/content/mynodetest

If you attempt this command with CURL, wrong characters are inserted into AEM. That is, you will see: "Ç , è , î , Ö , Ü , £ , P , Ä , " instead of "€ , Š , Œ , ™ , š , œ , ž , Ž , Ÿ".

To successfully post special characters to AEM and use them to set node values in the AEM JCR, you have to create a custom Sling Servlet that is able to handle UTF-8 (UCS Transformation Format—8-bit) encoded strings. This encoding type is a variable-width encoding that represents every character in the Unicode character set.

The Sling Servlet can decode the strings that contain special characters using Java application logic.

String id ="id"), "UTF-8");
String firstName ="firstName"),"UTF-8");

To post these special characters to the AEM Sling Servlet, encode the strings, as shown in this Java code example.

String val ="cust®", "UTF-8");
String firstName ="TOM®", "UTF-8");

To read this development article, click,

Join the Adobe Experience Cloud Community 

Join the Adobe Experience Cloud Community by clicking this banner

I (Scott Macdonald) am a Senior Digital Marketing Community Manager at Adobe Systems with 20 years in the high tech industry. I am also a programmer with knowledge in Java, JavaScript, C#,C++, HTML, XML and ActionScript. If  you would like to see more CQ or other Adobe Digital Marketing end to end articles like this, then leave a comment and let me know what content you would like to see.

TwitterFollow the Digital Marketing Customer Care team on Twitter @AdobeExpCare.

YouTube: Subscribe to the AEM Community Channel


  1. Hi, Scott,
    are we be able soon to use AEM restful APIs to post special characters to AEM?
    We are using C# as front end where we post data to AEM.

  2. You can use C# to post to a Sling Servlet. I have an example on this blog of using a C# client to post data to an AEM Servlet.

  3. Hi Scott,
    thanks for such prompt answer, but where actual problem is?
    Where is that AEM processing pipe goes wrong with special characters?
    What is that causes problem and can it be fixed on Adobe side?
    It causes us a lot of troubles.


  4. That is a good question. When ppl attempted to upload data with spec chars - for example - using CURL -- it did not work. That is why took the Servlet approach and encoding logic. It works - but you need to write a servlet.

  5. I learn some new stuff from it too, thanks for sharing your information.
    role of digital marketing