Error in short collumns in Vaandin

I’m a spanish user.
There is a error when short strings in Columns, during Grid. The problem is “ñ” or “Ñ”
The correct order is: m, n, ñ, o, p, q,r, s, t, u, v

But GRAÑA is before GRANDE, GUNT… The rest seems ok.

You mean sorting?

Sorting is done by Java String comparison. It might change if you use Spanish as system setting or you can supply your own comparator for the columns.

Yes, I use a Spanish system setting.
But whe I do a TreeSet in java like
"
TreeSet cen=new TreeSet();
cen.add(“GRANDE”);
cen.add(“PEQUEÑO”);
cen.add(“GRAÑA”);
cen.add(“BONITO”);
for (String linea:cen) {System.out.println(linea);}
"

My output is
BONITO
GRANDE
GRAÑA
PEQUEÑO

I will test it on my server where the Vaandin application runs, in case there is a configuration problem there.

And in my server, where it’s run vaandin

Attaching to texto-1
texto-1 | BONITO
texto-1 | GRANDE
texto-1 | GRAÑA
texto-1 | PEQUEÑO

I haven’t used TreeSet in ages so I can’t speak for it. But looks like it works differently from Java’s Comparator.

If you take a look at flow-components/vaadin-grid-flow-parent/vaadin-grid-flow/src/main/java/com/vaadin/flow/component/grid/Grid.java at 24548849376d987dd017ea8356a279ee4049c172 · vaadin/flow-components · GitHub you can see the usage of natural ordering.

A quick Google search got me to: it doesn’t care about language specific stuff. Use Collator.

Soooo. Create your own setComparator on the columns using a Collator