Sorting Umlaute

Hi

Can I sort umlaute as if they were characters without quotes? E.g. in a list:
ab
a(uml)c
ad

instead of
ab
ad
a(uml)c

Best regards
Birgit

What do you want to sort? A dataset, a foundset, an array?

There is a method to create your own sort method for arrays within Servoy.

A foundset and dataset should, imho, be sorted correct when using UTF-8/16 but I can imagine that this is depending on the database used…

Hi Marcel Trapman

Thank you for your help.

I usually have table views displaying records of a table. Lets say students. And I want to sort them by last name. Then I get all A before I get all A(Umlaut)

Andres
Arnold
A"bersold
A"rni

I mean they ARE sorted but not the way I prefer. I would like to ignore the Umlaut. I would like to have them sorted as if the A" would be a normal A:

A"bersold
Andres
A"rni
Arnold

Under preferences/DB Server/Database Server URL we have defined:
jdbc:sybase:Tds:…&CHARSET=utf8
Ok?

Thanks
Birgit

The link includes UTF-8 settings but that doesn’t say anything about your database abviously. Anyway I assume they are UTF-8 otherwise you would have other difficulties.

Again, I don’t know how to get the sorting right but maybe this will help you to get going (didn’t read it) http://www.ianywhere.com/developer/product_manuals/sqlanywhere/1000/en/html/dbdaen10/da-natlang-s-7002849.html

This is absolutely not a matter of Servoy. What they do is something like

SELECT pk FROM table ORDER BY name

You get to see what the database returns. So your question has to be answered from the database vendor you are using.

Patrick

I always thought there were two ‘legitimate’ ways to spell a word in German with an umlaut: either with the umlaut or simply the letter followed by ‘e’. If that is the case shouldn’t it sort Umlauted letters simply as though they were the letter with the next sort based on the following letter namely ‘e’. I’m just curious. I went to a German-speaking school for six year but it was a long time ago and maybe the convention of the ‘e’ just came about because typewriters or whatever didn’t have umlauts and this was a workaround.

In any case though even if the database itself doesn’t see it/sort it correctly, couldn’t you use the sort dialog to give it the ‘right’ sort? Get the column contents of a foundset in an array (name column and id column), sort the array based on name correctly after replacing the umlaut character(s), extract the id and then pass that id array as the argument to the sort dialog? I haven’t done it but I think that works. At that point Servoy isn’t sending an ‘ORDER BY’ statement I believe but simply doing a re-order itself in the UI.

That could work…but what if your foundset is a million records?

Would the user have enough patience to wait for the million records to be transferred to the client to be sorted? Would your servoy client have enough ram to hold it all for sorting? Would the user be happy to wait some more for Servoy to load the array of pk’s after the sort?
I think you get the picture. ;)

You do want to do this on the server, preferably by the database server.

Thank you, John Allen, for your answer.

I’d say, the ‘e’ really was a workaround. And today we got used to the fact that computers and there programs can handle the umlaut. I’m sure our customers wouldn’t like to see the umlaute in the names of the students replaced with char+e.

But: My sister in law is named Baer. Not Ba"r. This case exists, too :-)

But, back to DB and Servoy. I’ll check next week what the database will return when I do a SELECT…ORDER BY name.

When I define a sort order in the properties list of Servoy, then I thought Servoy would do the sort itself and not the DB. Am I wrong?

And: I don’t say, the actual sort is wrong. It is a possible way to sort umlaute. But it is much more common to have them sorted the way I asked for. E.g. now I get all A… then all A"… then B…, C… I’m used to have them sorted as if A" would be an A. Replacing A" with Ae is not the same.

I hope I explained my problem good enough. Regards
Birgit

Hi

I finally tried again to solve this problem and found

  • your link was a great hint
  • it was not the charset
  • it is the collation which defines the sorting (aUmlaut is equal to a etc.)

until now I only found "set temporary option sort_collation=‘51’ "
which makes the sorting right. I hope to find something permanent for the db or the connetion (via jdbc).

Thanks again and regards
Birgit