Page tree
Skip to end of metadata
Go to start of metadata

Enable UTF-8 character encoding in page names

Enable URI encoding in your Web container configuration:

 For Apache Tomcat:

set  URIEncoding="UTF-8"  in the  Connector section in  conf/server.xml :

  1. server.xml


    <Connector port="8080" protocol="HTTP/1.1"
           useBodyEncodingForURI="true" />

For JBoss AS, add the following section in  standalone.xml  or  domain.xml right after the  extensions  section.

standalone.xml or domain.xml


        <property name="org.apache.catalina.connector.URI_ENCODING" value="UTF-8"/>
        <property name="org.apache.catalina.connector.USE_BODY_ENCODING_FOR_QUERY_STRING" value="true"/>

Enable Unicode support for content node and page names.

Set the magnolia.utf8.enabled property in a file.


# Activate UTF-8 support to pages

This allows you to use a variety of non-ASCII characters in node names.

HTML page encoding

Sites built using Magnolia Templating Essentials templates identify the encoding as UTF-8 with an HTML meta element.


<meta charset="utf-8">

Al Arabiya an example of an Arabic language site built with Magnolia. The Arabic script is written from right to left a cursive style. The characters are included in UTF-8.

Support 6688 - Change encoding for just one page using ISO-8859-1 instead of UTF-8

Setting FTL renderer for UTF-8

[#setting output_encoding = "ISO-8859-1"]


resp.setContentType("text/html; charset=ISO-8859-1");
Writer out = resp.getWriter();

Instead of writing the response as string we used the byte array we got from org.apache.commons.codec.binary.Base64.decodeBase64.

Apache mod_mime

Associates the requested filename's extensions with the file's behavior (handlers and filters) and content (mime-type, language, character set and encoding)

This module is used to assign content metadata to the content selected for an HTTP response by mapping patterns in the URI or filenames to the metadata values. For example, the filename extensions of content files often define the content's Internet media type, language, character set, and content-encoding. This information is sent in HTTP messages containing that content and used in content negotiation when selecting alternatives, such that the user's preferences are respected when choosing one of several possible contents to serve. See mod_negotiation for more information about content negotiation.


Here is an example from their docs:

HTML: <META HTTP-EQUIV="content-type" CONTENT="text/html; charset=utf-8">
JSP: <%@ page contentType="text/html; charset=utf-8"%>
SiteMesh template: <page:applyDecorator name="form" encoding="utf-8">...</page:applyDecorator>



SUPPORT 6688 ticket



  • No labels