Cannot search special characters like ß in Name

Description

Hi, trying to search a product by Name with ß in the search string doesn't work.

Found the issue is caused by the difference between postgresql UPPER vs java toUpperCase function.

  • Name = Faß

  • postgresql -> SELECT UPPER(Name) = FAß

  • java -> "Faß%".toUpperCase = FASS%

A possible solution can be to use LOWER instead of UPPER - but maybe that could affect other languages?

Also, noticed that the default Locale is not set according to the login language, but the client computer.
the following patch could solve that problem:

Environment

None

Activity

Show:
Ricardo Alexsander Santana
May 24, 2018, 2:05 PM

We have a similar problem with some special characters in Portuguese language. We are planning to use the unaccent function in Postgres. I've made some tests I think it can be used with ß as well using Postgres 9.6+.

First you need to enable the UNACCENT extension:

If you run the query:

The result will be:

If you are running Postgres 9.5 or lower the result is different:

I've not tested but based on the article below, I found that Oracle has a similar function with same results, maybe we could change the FindWindow.java and solve both cases. WDYT?

https://community.oracle.com/thread/1117030

Carlos Ruiz
May 24, 2018, 3:37 PM

Thanks , I think I found a good fix with
https://bitbucket.org/idempiere/idempiere/commits/f2c01d6

Fixed also the Info Window that was not working.

I think the unaccent would not solve the problem because it was caused by mismatch between the java toUppercase function and the database function UPPER.

Regards,

Carlos Ruiz

Fixed

Assignee

Carlos Ruiz

Reporter

Carlos Ruiz

Labels

None

Tested By

None

Priority

Major
Configure