0

My database is running on Postgresql 9.3, the application itself is ran on Apache Tomcat 8.5.3. The application involved is PopCommerce.

The database uses UTF8 encoding:


   Name    |  Owner   | Encoding  | Collate | Ctype |   Access privileges
-----------+----------+-----------+---------+-------+------------------------
 moquidb   | postgres | UTF8      | C       | C     | 

I have not changed default settings (regarding locales) on any of the servers, neither the database server, nor the Apache.

Current application behavior is confusing. I imported my customer's list of suppliers (mantle.party.Party + mantle.party.Organization), all in slovak language with accented characters - á, š, č, ž, etc. Everything seems fine, until I start using the search in FindSupplier screen (and elsewhere too).

Let's assume I want to find suppliers having organizationName starting with letters 'Hús'. After I write the string 'Hús' into the Name text-find (input box) and hit Find button, a new screen renders with incorrect text in the Name box - 'Hús'. The letter 'ú' was replaced with 'ú'. No search result, of course.

What is the correct way to setup the database and application server to support accented characters?

When developing, and running Moqui on my notebook with embedded database, nothing like this happened. I suspect the setting on servers should be changed. Any help appreciated.

Daniel Vérité
  • 58,074
  • 15
  • 129
  • 156
mrovnanik
  • 123
  • 9
  • It seems like this is a matter of incorrect configuration of the PostgreSQL and/or Apache Tomcat server. When I run the application on the same host but in a standalone container (with same data loaded), the problem does not occur. – mrovnanik Jul 09 '16 at 11:42

1 Answers1

1

Hope this helps anyone facing similar problems. In my case, these steps helped me out. The very first thing I was able to determine was the fact, that it was the Tomcat server causing the behavior. When I ran Moqui in a its servlet (standalone mode) against the very same database, the problem did not occur.

So I modified the Tomcat's configuration to make sure, the communication (specifically the server's responses) are encoded usign UTF-8:

  1. set URIEncoding="UTF-8" on your Connector tag in server.xml (conf/server.xml) -> simply add an attribute to the existing configuration,
  2. turn setCharacterEncodingFilter on - edit web.xml (conf/web.xml), there is a commented tag (in version 8.5 of Tomcat it is around line 465) in the web.xml. Check the configuration described in other thread on Stackoverflow (go to the second link below for more details).

These were the sources for me:

https://wiki.apache.org/tomcat/FAQ/CharacterEncoding#Q3

Tomcat 7 org.apache.catalina.filters.AddDefaultCharsetFilter not using UTF-8

Community
  • 1
  • 1
mrovnanik
  • 123
  • 9
  • Please [accept your answer](http://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work) if it solved your problem. – Daniel Vérité Jul 21 '16 at 15:47