Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Spanish characters in data.xml from AEM forms submission cannot be recognized on publisher

DavidZhang
Level 3
Level 3

We have an AEM 6.5.8 form display in Spanish and works fine for submission as well, all the fields with spanish character in data.xml are working fine:

{"afData": {"afBoundData": {"data": {"latamInfo": {"topMarginContainer": {"nasNo": "5007699", "reportNo": "ü, é, á, í, ó, ú, ñ, Ñ, ¿, ¡, Á, É, Í, Ó, Ú, Ü"...

 

However, the same code and form when replicate to publish server, I got this when submit:

{"afData":{"afBoundData":{"data":{"latamInfo":{"topMarginContainer":{"nasNo":"5007699","reportNo":"�, �, �, �, �, �, �, �, �, �, �, �, �, �, �, �"...

 

Why the exact same form and code behave different on author and publisher?

 

 

 

 

 

4 Replies
DavidZhang
Level 3
Level 3

Even restarted publisher server to make sure no cache issue. Still the same result.

Bimmi_Soi
Community Advisor
Community Advisor

@DavidZhang ,

 

Can you try this  :

  • Go to http://aemhost /system/console/configMgr/org.apache.sling.engine.parameters and log in as admin on publish and author

  • Set Default Parameter Encoding to UTF-8

  • Click Save

     

    Hope this helps!

    Thanks

DavidZhang
Level 3
Level 3
It's already utf-8, even just lower case for both author and publisher. Author works fine, not publisher.
ChitraMadan
Community Advisor
Community Advisor

Hi @DavidZhang,

 

You can try below options as well:

 

1) Try to set encoding in the form using accept-charset

<form name="formname"  method="post" accept-charset="UTF-8" enctype="multipart/form-data" action="WHATEVER">

 

2) If you are using Servlet, you can set encoding in the response header

 

response.setCharacterEncoding(CharEncoding.UTF_8);

 

 

Thanks,

Chitra

DavidZhang
Level 3
Level 3
I am using AEM forms, From where I can set the accept-charset or change response? I checked the my form properties and form container properties, there's no where I can set it. It's not java or HTML coding.
DavidZhang
Level 3
Level 3
Thanks a lot, however, not sure how to go to the page you mentioned(on AEM, cannot find adminconsole, if this is for the livecycle server, we are not going to livecycle. The form submitted from AEM to workflow data.xml is already messed). we want to know how to configure the AEM form, but seems default to accept-charset in HTTP header already UTF-8, but still the payload is messed for Spanish).
k_mers
Level 1
Level 1

Were you able to figure out the solution to this issue? We're experience the exact same thing.

DavidZhang
Level 3
Level 3

In the request parameters, put afAcceptLang as request URL parameter, for example:

 

http://localhost:4503/content/forms/af/xyzform.html?dataRef=a=b&afAcceptLang=es

k_mers
Level 1
Level 1

Thanks for the reply. Unfortunately, that did not make any difference for me. Did you have to change any OSGI setting on the publisher? Odd that it behaves differently between author and publish when storing the data.xml with special characters.

DavidZhang
Level 3
Level 3

This is exactly the problem we had before^_^.

Solution: save your payload to database or your own whatever repository before you call workflow. Then in workflow, read your saving and put as workflow parameters or replace data.xml.

We are doing this now and no problem in PROD for a few months.

It's very weird that something working on author but not publisher.

I don't think any OSGI setting can save you since AEM servlet doesn't take any configuration, including locale.