UTF characters not stored or displayed properly after saving dialog

Issue

Touch ui dialog text field with sling:resourceType=granite/ui/components/coral/foundation/form/textfield incorrectly converts Latin characters. For example, "Eléctricos" gets saved as "Eléctricos".

This issue applies to many international language characters.

Cause

The default character encoding used by Sling is not UTF.

Resolution

To force the dialog to save data in UTF character encoding, you can add a hidden element to the dialog form (solution A) or set default encoding to UTF-8 (solution B).

A. Add a hidden element to the dialog form 

  1. Go to http://aemhost/crx/de/index.jsp and log in as admin

     

  2. Go to your dialog node, for example, /apps/sitename/components/content/customtext/cq:dialog/content/items/settings/items/columns/items/displayAs/items

     

  3. Create a subnode charset with the following properties:

    sling:resourceType (String) = granite/ui/components/coral/foundation/form/hidden
    ignoreData (Boolean) = true
    name (String) = _charset
    _value (String) = utf-8

    Alternatively you can copy a similar node from the /libs directory.  For example, this node /libs/cq/personalization/touch-ui/content/commons/createpagewizard/jcr:content/body/items/form/items/charset

  4. Click Save All

B. Set the default character encoding to UTF-8

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

  2. Set Default Parameter Encoding to UTF-8

  3. Click Save

 Adobe

Saņemiet palīdzību ātrāk un vienkāršāk

Jauns lietotājs?

Adobe MAX 2024

Adobe MAX

The Creativity Conference

14.–16. oktobris Maiami pludmalē un tiešsaistē

Adobe MAX 2024

Adobe MAX

The Creativity Conference

14.–16. oktobris Maiami pludmalē un tiešsaistē