Problem With Turkish Characters During Retrieve

0
We're facing problems while retrieving objects if they contain Turkish characters especially with "İ" and "I" characters. Because these characters don't match as they're in English. Because lower case of "I" is "i" in English but it's "ı" in Turkish. Completely different charset. We've tried to change our database collation to "tr-TR" but found out that this problem only occurs if we choose microflow as data source. When datasource is set to Database there's no problem but we can't retrieve certain objects or filter when data source is set to Microflow. We request help about this problem and guidance how to overcome this.We faced this problem in multiple widgets(textbox, combobox, searchable selector). As a workaround solution we kept uppercase and lowercase versions of data so we could search from those attributes. But duplicating datas isn't a good solution.PS: We're using PostgreSQL db.We'd like to know if you have any other suggestions or guidance.
asked
1 answers
0

Hi Alperen Sertoğlu


Microflow filtering runs in Java, which doesn't know about Turkish characters by default. You just need to tell Java explicitly to use Turkish locale when comparing strings.


Step 1 — Create a Java Action in Mendix

Name it NormalizeturkishText with:

  • Input: String inputText
  • Output: String
import java.util.Locale;

public String executeAction() {
    if (inputText == null) return "";
    return inputText.toLowerCase(new Locale("tr", "TR"));
}

Step 2 — Use it in your Microflow

Before comparing/filtering, normalize both the stored value and the search input:

[NormalizeTurkishText(Name) = NormalizeTurkishText($SearchText)]


answered