<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>[SOLVED] Wrong characters in portlets with special characters</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=112025038" />
  <subtitle>[SOLVED] Wrong characters in portlets with special characters</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=112025038</id>
  <updated>2026-04-06T03:55:11Z</updated>
  <dc:date>2026-04-06T03:55:11Z</dc:date>
  <entry>
    <title>RE: Wrong characters in portlets with special characters</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112041568" />
    <author>
      <name>Carlos Durán</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112041568</id>
    <updated>2019-01-17T14:58:00Z</updated>
    <published>2019-01-17T14:58:00Z</published>
    <summary type="html">&lt;p&gt;Finally, I found a solution.&lt;/p&gt;
&lt;p&gt;It seems that I had to compile the project using the ISO-8859-1
  encoding in the JSP file. Now the special characters are displayed correctly.&lt;/p&gt;
&lt;p&gt;Thanks for the help!&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</summary>
    <dc:creator>Carlos Durán</dc:creator>
    <dc:date>2019-01-17T14:58:00Z</dc:date>
  </entry>
  <entry>
    <title>RE: Wrong characters in portlets with special characters</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112036831" />
    <author>
      <name>Carlos Durán</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112036831</id>
    <updated>2019-01-17T10:01:03Z</updated>
    <published>2019-01-17T10:01:03Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;p&gt;After compile project (using &lt;code&gt;gradlew deploy&lt;/code&gt;), I've
  unzipped de JAR generated and I've opened the view.jsp file to make
  sure the encoding (and it is UTF-8).&lt;/p&gt;
&lt;p&gt;I've deployed the JAR file in the portal and I've founded the
  file&amp;nbsp;&lt;strong&gt;liferay-ce-portal-7.1.1-ga2/work/org.tests.liferay-1.0.0/org/apache/jsp/view_jsp.java&lt;/strong&gt;
  with this content:&lt;/p&gt;
&lt;pre&gt;
package org.apache.jsp;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;

public final class view_jsp extends org.apache.jasper.runtime.HttpJspBase
    implements org.apache.jasper.runtime.JspSourceDependent {

  private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();

  private static java.util.List&amp;lt;String&amp;gt; _jspx_dependants;

  static {
    _jspx_dependants = new java.util.ArrayList&amp;lt;String&amp;gt;(7);
    _jspx_dependants.add("/init.jsp");
    _jspx_dependants.add("/META-INF/c.tld");
    _jspx_dependants.add("/META-INF/liferay-portlet_2_0.tld");
    _jspx_dependants.add("/META-INF/liferay-aui.tld");
    _jspx_dependants.add("/META-INF/liferay-portlet-ext.tld");
    _jspx_dependants.add("/META-INF/liferay-theme.tld");
    _jspx_dependants.add("/META-INF/liferay-ui.tld");
  }

  private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_liferay$1theme_defineObjects_nobody;
  private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_portlet_defineObjects_nobody;

  private org.glassfish.jsp.api.ResourceInjector _jspx_resourceInjector;

  public java.util.List&amp;lt;String&amp;gt; getDependants() {
    return _jspx_dependants;
  }

  public void _jspInit() {
    _jspx_tagPool_liferay$1theme_defineObjects_nobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
    _jspx_tagPool_portlet_defineObjects_nobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
  }

  public void _jspDestroy() {
    _jspx_tagPool_liferay$1theme_defineObjects_nobody.release();
    _jspx_tagPool_portlet_defineObjects_nobody.release();
  }

  public void _jspService(HttpServletRequest request, HttpServletResponse response)
        throws java.io.IOException, ServletException {

    PageContext pageContext = null;
    HttpSession session = null;
    ServletContext application = null;
    ServletConfig config = null;
    JspWriter out = null;
    Object page = this;
    JspWriter _jspx_out = null;
    PageContext _jspx_page_context = null;

    try {
      response.setContentType("text/html");
      pageContext = _jspxFactory.getPageContext(this, request, response,
                  null, true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;
      _jspx_resourceInjector = (org.glassfish.jsp.api.ResourceInjector) application.getAttribute("com.sun.appserv.jsp.resource.injector");

      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write("\n");
      //  liferay-theme:defineObjects
      com.liferay.taglib.theme.DefineObjectsTag _jspx_th_liferay$1theme_defineObjects_0 = (com.liferay.taglib.theme.DefineObjectsTag) _jspx_tagPool_liferay$1theme_defineObjects_nobody.get(com.liferay.taglib.theme.DefineObjectsTag.class);
      _jspx_th_liferay$1theme_defineObjects_0.setPageContext(_jspx_page_context);
      _jspx_th_liferay$1theme_defineObjects_0.setParent(null);
      int _jspx_eval_liferay$1theme_defineObjects_0 = _jspx_th_liferay$1theme_defineObjects_0.doStartTag();
      if (_jspx_th_liferay$1theme_defineObjects_0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
        _jspx_tagPool_liferay$1theme_defineObjects_nobody.reuse(_jspx_th_liferay$1theme_defineObjects_0);
        return;
      }
      _jspx_tagPool_liferay$1theme_defineObjects_nobody.reuse(_jspx_th_liferay$1theme_defineObjects_0);
      out.write('\n');
      out.write('\n');
      //  portlet:defineObjects
      com.liferay.taglib.portlet.DefineObjectsTag _jspx_th_portlet_defineObjects_0 = (com.liferay.taglib.portlet.DefineObjectsTag) _jspx_tagPool_portlet_defineObjects_nobody.get(com.liferay.taglib.portlet.DefineObjectsTag.class);
      _jspx_th_portlet_defineObjects_0.setPageContext(_jspx_page_context);
      _jspx_th_portlet_defineObjects_0.setParent(null);
      int _jspx_eval_portlet_defineObjects_0 = _jspx_th_portlet_defineObjects_0.doStartTag();
      if (_jspx_th_portlet_defineObjects_0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
        _jspx_tagPool_portlet_defineObjects_nobody.reuse(_jspx_th_portlet_defineObjects_0);
        return;
      }
      _jspx_tagPool_portlet_defineObjects_nobody.reuse(_jspx_th_portlet_defineObjects_0);
      out.write("\n");
      out.write("\n");
      out.write("&amp;lt;p&amp;gt;Ãlava Ãpico SÃ­smico MetÃ³dico LÃºdico EspaÃ±a&amp;lt;/p&amp;gt;\n");
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)){
        out = _jspx_out;
        if (out != null &amp;amp;&amp;amp; out.getBufferSize() != 0)
          out.clearBuffer();
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
        else throw new ServletException(t);
      }
    } finally {
      _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
}
&lt;/pre&gt;
&lt;p&gt;I think the problem is that is generating the line&lt;/p&gt;
&lt;pre&gt;
out.write("&amp;lt;p&amp;gt;Ãlava Ãpico SÃ­smico MetÃ³dico LÃºdico EspaÃ±a&amp;lt;/p&amp;gt;\n");&lt;/pre&gt;
&lt;p&gt;but I don't know why it is happening.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Carlos Durán</dc:creator>
    <dc:date>2019-01-17T10:01:03Z</dc:date>
  </entry>
  <entry>
    <title>RE: Wrong characters in portlets with special characters</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112032351" />
    <author>
      <name>Olaf Kock</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112032351</id>
    <updated>2019-01-16T19:20:22Z</updated>
    <published>2019-01-16T19:20:22Z</published>
    <summary type="html">&lt;blockquote&gt;
  &lt;div class="quote-title"&gt;Carlos Durán:&lt;/div&gt;
  &lt;div class="quote"&gt;
    &lt;div class="quote-content"&gt;
      &lt;p&gt;The problem is not related with the URL. I'll give you an example.&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;
&lt;p&gt;It could be the build process, packaging the files in unexpected
  encoding. Check the artifact JAR or WAR file: Unpack and analyze the
  resources in there.&lt;/p&gt;
&lt;p&gt;In older versions, Liferay language resources (e.g.
  Language.properties) needed to be UTF-8 encoded. I'm not aware if this
  is still the case or not - but it's a potential point for confusion.
  Regular build tools will encode them in ISO-8859-1&lt;br /&gt;  &lt;/p&gt;</summary>
    <dc:creator>Olaf Kock</dc:creator>
    <dc:date>2019-01-16T19:20:22Z</dc:date>
  </entry>
  <entry>
    <title>RE: Wrong characters in portlets with special characters</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112027413" />
    <author>
      <name>Carlos Durán</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112027413</id>
    <updated>2019-01-16T17:10:56Z</updated>
    <published>2019-01-16T17:10:56Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;p&gt;The problem is not related with the URL. I'll give you an example.&lt;/p&gt;
&lt;p&gt;I have this code in my &lt;code&gt;view.jsp&lt;/code&gt; file:&lt;/p&gt;
&lt;pre&gt;
&amp;lt;%@ include file="/init.jsp" %&amp;gt;

&amp;lt;p&amp;gt;Álava Épico Sísmico Metódico Lúdico España&amp;lt;/p&amp;gt;&lt;/pre&gt;
&lt;p&gt;When I deploy the portlet, it is showed like this in the portal:&lt;/p&gt;
&lt;pre&gt;
Ãlava Ãpico SÃ­smico MetÃ³dico LÃºdico EspaÃ±a&lt;/pre&gt;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Carlos Durán</dc:creator>
    <dc:date>2019-01-16T17:10:56Z</dc:date>
  </entry>
  <entry>
    <title>RE: Wrong characters in portlets with special characters</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112027066" />
    <author>
      <name>David H Nebinger</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112027066</id>
    <updated>2019-01-16T16:53:13Z</updated>
    <published>2019-01-16T16:53:13Z</published>
    <summary type="html">&lt;p&gt;For URLs, UTF8 chars have to be encoded, they cannot be in the URL as-is.&lt;/p&gt;
&lt;p&gt;Whatever is building your URL is not properly encoding the UTF8 chars.&lt;/p&gt;</summary>
    <dc:creator>David H Nebinger</dc:creator>
    <dc:date>2019-01-16T16:53:13Z</dc:date>
  </entry>
  <entry>
    <title>[SOLVED] Wrong characters in portlets with special characters</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112025037" />
    <author>
      <name>Carlos Durán</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112025037</id>
    <updated>2019-01-16T15:45:36Z</updated>
    <published>2019-01-16T15:45:36Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;p&gt;I have a&amp;nbsp;Liferay 7.1 Tomcat bundle in a Fedora OS. When I load a
  portlet with special characters (á, é, ñ...)&amp;nbsp;they are showed like this:&lt;/p&gt;
&lt;p&gt;
  &lt;img src="https://i.ibb.co/vd5CvGt/caracter-erroneo.png" style="border: 1.0px solid rgb(102,102,102);"&gt;&lt;/p&gt;
&lt;p&gt;The settings that can affect the character encoding, I have them like this:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Tomcat starts with parameter&amp;nbsp;&lt;code&gt;-Dfile.encoding=UTF8&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;In Eclipse, the JSP file uses &lt;code&gt;UTF-8&lt;/code&gt; encoding&lt;/li&gt;
  &lt;li&gt;In the web page source code I can see this tag:&amp;nbsp;&amp;nbsp;&lt;code&gt;&amp;amp;lt;meta
      content="text/html; charset=UTF-8" http-equiv="content-type"&amp;amp;gt;&lt;/code&gt;.&lt;/li&gt;
  &lt;li&gt;Watching the &lt;strong&gt;System properties&lt;/strong&gt; in the Portal
    Control Panel, the value of the property &lt;code&gt;file.encoding&lt;/code&gt;
    is &lt;code&gt;UTF-8&lt;/code&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;If I put the same text in the&amp;nbsp;&lt;code&gt;Language.properties&lt;/code&gt;&amp;nbsp;file
  and I load it with the&amp;nbsp;&lt;code&gt;liferay-ui:message&lt;/code&gt;&amp;nbsp;tag, the text
  appears correctly.&lt;/p&gt;
&lt;p&gt;If I place the snippet&amp;nbsp;&lt;code&gt;&amp;amp;lt;%@ page
    pageEncoding="UTF-8" %&amp;amp;gt;&lt;/code&gt;&amp;nbsp;at the top of the JSP
  the text appears correctly too.&lt;/p&gt;
&lt;p&gt;I made sure with another text editor (Geany)&amp;nbsp;that JSP encoding is UTF-8.&lt;/p&gt;
&lt;p&gt;Other things I tried that haven't&amp;nbsp;worked:&lt;/p&gt;
&lt;p&gt;- I added&amp;nbsp;this configuration in &lt;code&gt;build.gradle&lt;/code&gt; file:&lt;/p&gt;
&lt;pre&gt;
compileJava.options.encoding = 'UTF-8'

tasks.withType(JavaCompile) {
    options.encoding = 'UTF-8'
}&lt;/pre&gt;
&lt;p&gt;- I have tried to make a portlet using Maven.&lt;/p&gt;
&lt;p&gt;- I have used the portal with Hypersonic DB and MySQL (with CHARACTER
  SET UTF-8).&lt;/p&gt;
&lt;p&gt;Any idea?&lt;/p&gt;
&lt;p&gt;Regards.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Carlos Durán</dc:creator>
    <dc:date>2019-01-16T15:45:36Z</dc:date>
  </entry>
</feed>
