PDA

View Full Version : how to locale compare two string ?



narutokage
13th August 2011, 15:28
I want to compare two latin qstring
like that:
compare("â","e",locale(a certain country)) return ( e > â in latin character)
thank a lot
sorry for my stupid english . I can't express my thoughts clearly

ChrisW67
15th August 2011, 00:05
In the ISO 8859-1 (Latin 1) character set ('e' > 'â') is false. Are you saying that you want à , á, â, ã, ä, and å to be treated as if they were 'a' for comparison ?

narutokage
16th August 2011, 06:54
In the ISO 8859-1 (Latin 1) character set ('e' > 'â') is false. Are you saying that you want à , á, â, ã, ä, and å to be treated as if they were 'a' for comparison ?

thank for reply !!
but. I want to make a international dictionary. I use binary search and It need:
Performing Locale-Independent Comparisons (in java)
http://download.oracle.com/javase/tutorial/i18n/text/locale.html

this feature is so great. You can apply to many algorithms (sort,search.....)
so what is like that in QT ?

ChrisW67
16th August 2011, 08:07
Is QString::localeAwareCompare() what you are looking for?

narutokage
16th August 2011, 09:13
Is QString::localeAwareCompare() what you are looking for?
thank !!
but I am not sure, may you give me a short example ??