@Fred Sortroutine

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Pinhead
User
User
Posts: 47
Joined: Fri Sep 09, 2005 11:24 pm

@Fred Sortroutine

Post by Pinhead »

Hello,
the sort-procedure place ü,ö,ä at the end of the list. Is it possible
to implement for german User that sort use internel a=ä,u=ü,o=ö,
because ü,ö,ä at the end oft the list is wrong..

Greetings Volker
User avatar
Thorsten1867
Addict
Addict
Posts: 1372
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Post by Thorsten1867 »

That would be a good idea!!!
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

This is not realistic to do that for all langages.. You can still replace all these letter with the non-accent one, sort it, and put back the original strings in it.
Pinhead
User
User
Posts: 47
Joined: Fri Sep 09, 2005 11:24 pm

Post by Pinhead »

so I do...
Thanx for the Answer!
Your Sort-Procedure is very very fast!
User avatar
Michael Vogel
Addict
Addict
Posts: 2797
Joined: Thu Feb 09, 2006 11:27 pm
Contact:

Post by Michael Vogel »

Fred wrote:This is not realistic to do that for all langages.. You can still replace all these letter with the non-accent one, sort it, and put back the original strings in it.
Can be complicate with unicode, but using one byte chars, the sort routine could have an additional parameter pointing to a 256 byte table which includes the sort order you like.

But maybe all (western) countries would sort in the same way?
Concentrating on the alphabet (the order of cyphers etc. should be equal everywhere), I would say, it is typical to put all variations of 'a' at the beginning, with accents (á, à, ä, å, ã, â, æ etc.) After that there is 'b', then 'c' (followed by cedille?) etc.
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

No. Let me show you a sorted list in my language

a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
æ
ø
å
User avatar
Michael Vogel
Addict
Addict
Posts: 2797
Joined: Thu Feb 09, 2006 11:27 pm
Contact:

Post by Michael Vogel »

Trond wrote:No. Let me show you a sorted list in my language

a
:
y
z
æ
ø
å
Will that be the same in finland, sweden, danmark etc.?
User avatar
utopiomania
Addict
Addict
Posts: 1655
Joined: Tue May 10, 2005 10:00 pm
Location: Norway

Post by utopiomania »

I think you can (should) use the CompareString() API to compare strings correctly for different locales.

The rules are very complex, so better leave it to an API and some suitable sorting algorithm.
maw

Post by maw »

Will that be the same in finland, sweden, danmark etc.?
No, we dont even have the same characters :)

In Sweden we use: ABCDEFGHIJKLMNOPQRSTUVWXYZÅÄÖ
User avatar
Michael Vogel
Addict
Addict
Posts: 2797
Joined: Thu Feb 09, 2006 11:27 pm
Contact:

Post by Michael Vogel »

maw wrote:
Will that be the same in finland, sweden, danmark etc.?
No, we dont even have the same characters :)

In Sweden we use: ABCDEFGHIJKLMNOPQRSTUVWXYZÅÄÖ
Bad luck, I just tried it :)

unused chars wouldn't be a problem, but chars in different order ('Ä' after 'Å' in swedish, between 'A' and 'B' in german etc.) would lead to implement different sorting arrays...
Post Reply