Re: [firebird-support] Case and Accent insensitive compares

2016-06-16 Thread Dimitry Sibiryakov s...@ibphoenix.com [firebird-support]
16.06.2016 15:30, Stefan Heymann li...@stefanheymann.de [firebird-support] 
wrote:
> How can I work with that DE_DE_AI collation you mention? Firebird
> doesn't seem to know it.

   According to README.intl you must create it in database using CREATE 
COLLATION query. I 
hope Adriano can shed more light on it.


-- 
   WBR, SD.






++

Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu.  Try FAQ and other links from the left-side menu there.

Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/ 

++


Yahoo Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/firebird-support/join
(Yahoo! ID required)

<*> To change settings via email:
firebird-support-dig...@yahoogroups.com 
firebird-support-fullfeatu...@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
firebird-support-unsubscr...@yahoogroups.com

<*> Your use of Yahoo Groups is subject to:
https://info.yahoo.com/legal/us/yahoo/utos/terms/



Re: [firebird-support] Case and Accent insensitive compares

2016-06-16 Thread Stefan Heymann li...@stefanheymann.de [firebird-support]
> UNICODE_AI collation is useless, but DE_DE_AI can work unless Stefan
> needs to keep words in other languages in the same field as well.

That's the point. I don't know what language is used (can be every
European language) and so I'll have to live with that.

How can I work with that DE_DE_AI collation you mention? Firebird
doesn't seem to know it.


Regards

Stefan




Re: [firebird-support] Case and Accent insensitive compares

2016-06-16 Thread Dimitry Sibiryakov s...@ibphoenix.com [firebird-support]
16.06.2016 11:33, Dimitry Sibiryakov s...@ibphoenix.com [firebird-support] 
wrote:
> unless Tomas need to keep words

   Oops, it was Stefan, of course. I'm sorry.


-- 
   WBR, SD.






++

Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu.  Try FAQ and other links from the left-side menu there.

Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/ 

++


Yahoo Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/firebird-support/join
(Yahoo! ID required)

<*> To change settings via email:
firebird-support-dig...@yahoogroups.com 
firebird-support-fullfeatu...@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
firebird-support-unsubscr...@yahoogroups.com

<*> Your use of Yahoo Groups is subject to:
https://info.yahoo.com/legal/us/yahoo/utos/terms/



Re: [firebird-support] Case and Accent insensitive compares

2016-06-16 Thread Dimitry Sibiryakov s...@ibphoenix.com [firebird-support]
16.06.2016 11:03, Paul Vinkenoog p...@vinkenoog.nl [firebird-support] wrote:
> That's right. I can't think of any circumstances where you would want
> to consider 'hatten' and 'hätten' the same, for instance. Or Mutter and
> Mütter. Actually, I couldn't think of any German word where this would
> be the case. So when it's strictly about German, AI collations seem
> useless, except for catching certain foreign words and names likes
> Gérard/Gerard, or misspellings of Kekulé.

   UNICODE_AI collation is useless, but DE_DE_AI can work unless Tomas need to 
keep words 
in other languages in the same field as well.


-- 
   WBR, SD.


Re: Re: [firebird-support] Case and Accent insensitive compares

2016-06-16 Thread liviuslivius liviusliv...@poczta.onet.pl [firebird-support]
Hi,
 
you have right Paul and Stefan
sorry for previous answer - i miss that point
 
regards,
Karol Bieniaszewski
 
W dniu 2016-06-16 11:03:25 użytkownik Paul Vinkenoog p...@vinkenoog.nl 
[firebird-support]  napisał:
 
Hi Stefan,
> > Also, it is questionable if you should consider a and ä different
> > letters, even in German. See e.g.
> > https://de.wikipedia.org/wiki/Alphabetische_Sortierung
>
> For sorting, treating them as "same" is correct. However, for things
> like comparisons (in a unique key for example) they are not the same.
That's right. I can't think of any circumstances where you would want
to consider 'hatten' and 'hätten' the same, for instance. Or Mutter and
Mütter. Actually, I couldn't think of any German word where this would
be the case. So when it's strictly about German, AI collations seem
useless, except for catching certain foreign words and names likes
Gérard/Gerard, or misspellings of Kekulé.
Cheers,
Paul Vinkenoog
___
 

Re: [firebird-support] Case and Accent insensitive compares

2016-06-16 Thread Paul Vinkenoog p...@vinkenoog.nl [firebird-support]
Hi Stefan,

> > Also, it is questionable if you should consider a and ä different
> > letters, even in German. See e.g.
> > https://de.wikipedia.org/wiki/Alphabetische_Sortierung
>
> For sorting, treating them as "same" is correct. However, for things
> like comparisons (in a unique key for example) they are not the same.

That's right. I can't think of any circumstances where you would want
to consider 'hatten' and 'hätten' the same, for instance. Or Mutter and
Mütter. Actually, I couldn't think of any German word where this would
be the case. So when it's strictly about German, AI collations seem
useless, except for catching certain foreign words and names likes
Gérard/Gerard, or misspellings of Kekulé.

Cheers,
Paul Vinkenoog


Re: [firebird-support] Case and Accent insensitive compares

2016-06-16 Thread liviuslivius liviusliv...@poczta.onet.pl [firebird-support]
Hi,

you use wrong collation

UNICODE_CI is truly case-insensitive. In a search for e.g. 'Apple', it will 
also find 'apple', 'APPLE' and 'aPPLe'.
UNICODE_CI_AI is accent-insensitive as well. According to this collation, 
'APPEL' equals 'Appèl'.

as you can see UNICODE_CI_AI is accent-insensitive use "UNICODE_CI" instead

regards,
Karol Bieniaszewski

W dniu 2016-06-15 17:28:34 użytkownik Stefan Heymann li...@stefanheymann.de 
[firebird-support]  napisał:
> I expect that an accent insensitive compare treats accented characters
> as the "same" as their un-accented counterparts because the accent
> does not change the character itself but things like pronounciation or
> stress.
> 
> So in Frech, à is similar to a, é is similar to è and you use an
> accent insensitive compare to find Gérard even though your search term
> says Gerard (without the accent).
> 
> However, in the German language, the letters Ö and O are two different
> characters with a completely different pronounciation (the same is
> true for A/Ä and U/Ü). As they look similar, the sorting is done so
> that they stay together, but they can _not_ be treated as accented
> versions of each other.
> 
> When I use the UNICODE_CI_AI collation to compare them, Firebird
> treats them as the same:
> 
> select case when 'a' = 'ä' collate unicode_ci_ai then 'equal' else 'not 
> equal' end || ' expected: not equal' from rdb$database
> union all
> select case when 'O' = 'Ö' collate unicode_ci_ai then 'equal' else 'not 
> equal' end || ' expected: not equal' from rdb$database
> union all
> select case when 'Ä' = 'ä' collate unicode_ci then 'equal' else 'not equal' 
> end || ' expected: equal' from rdb$database
> union all
> select case when 'a' = 'à' collate unicode_ci_ai then 'equal' else 'not 
> equal' end || ' expected: equal' from rdb$database
> union all
> select case when 'c' = 'ç' collate unicode_ci_ai then 'equal' else 'not 
> equal' end || ' expected: equal' from rdb$database
> union all
> select case when 'é' = 'è' collate unicode_ci_ai then 'equal' else 'not 
> equal' end || ' expected: equal' from rdb$database
> 
> delivers:
> 
> equal expected: not equal
> equal expected: not equal
> equal expected: equal
> equal expected: equal
> equal expected: equal
> equal expected: equal
> 
> 
> Is there something that can be done to improve this?
> 
> 
> Regards
> 
> Stefan
> 
> -- 
> Stefan Heymann, Tübingen, Germany
> 
> 



Re: [firebird-support] Case and Accent insensitive compares

2016-06-16 Thread Stefan Heymann li...@stefanheymann.de [firebird-support]
> Also, it is questionable if you should consider a and ä different
> letters, even in German. See e.g. 
> https://de.wikipedia.org/wiki/Alphabetische_Sortierung

For sorting, treating them as "same" is correct. However, for things
like comparisons (in a unique key for example) they are not the same.

I understand that this is an international thing so I'll have to deal
with this behaviour. Thanks for your reply.


Stefan



Re: [firebird-support] Case and Accent insensitive compares

2016-06-15 Thread Paul Vinkenoog p...@vinkenoog.nl [firebird-support]
Hello Stefan,

> I expect that an accent insensitive compare treats accented characters
> as the "same" as their un-accented counterparts because the accent
> does not change the character itself but things like pronounciation or
> stress.
>
> So in Frech, à is similar to a, é is similar to è and you use an
> accent insensitive compare to find Gérard even though your search term
> says Gerard (without the accent).
>
> However, in the German language, the letters Ö and O are two different
> characters with a completely different pronounciation (the same is
> true for A/Ä and U/Ü). As they look similar, the sorting is done so
> that they stay together, but they can _not_ be treated as accented
> versions of each other.

UNICODE_CI_AI is a generic, language-independent collation. Since
ö, ü and ä are not specific to German (they also exist in Dutch, for
instance, and ö and ä in Swedish, and ö and ü in Hungarian, etc.)
it will simply treat them as accented forms of o, u and a.

Also, it is questionable if you should consider a and ä different
letters, even in German. See e.g. 
https://de.wikipedia.org/wiki/Alphabetische_Sortierung

DIN 5007 Variante 1 (für Wörter verwendet, etwa in Lexika; Abschnitt 6.1.1.4.1)

ä und a sind gleich
ö und o sind gleich
ü und u sind gleich
ß und ss sind gleich

DIN 5007 Variante 2 (spezielle Sortierung für Namenslisten, etwa in 
Telefonbüchern; Abschnitt 6.1.1.4.2)

ä und ae sind gleich
ö und oe sind gleich
ü und ue sind gleich
ß und ss sind gleich

If you do want to treat them as different letters, you need a German
collation that does just that. However, this collation will not work
correctly with words in some other languages containing ä, ö and ü.


Cheers,
Paul Vinkenoog


[firebird-support] Case and Accent insensitive compares

2016-06-15 Thread Stefan Heymann li...@stefanheymann.de [firebird-support]
I expect that an accent insensitive compare treats accented characters
as the "same" as their un-accented counterparts because the accent
does not change the character itself but things like pronounciation or
stress.

So in Frech, à is similar to a, é is similar to è and you use an
accent insensitive compare to find Gérard even though your search term
says Gerard (without the accent).

However, in the German language, the letters Ö and O are two different
characters with a completely different pronounciation (the same is
true for A/Ä and U/Ü). As they look similar, the sorting is done so
that they stay together, but they can _not_ be treated as accented
versions of each other.

When I use the UNICODE_CI_AI collation to compare them, Firebird
treats them as the same:

select case when 'a' = 'ä' collate unicode_ci_ai then 'equal' else 'not equal' 
end || ' expected: not equal' from rdb$database
union all
select case when 'O' = 'Ö' collate unicode_ci_ai then 'equal' else 'not equal' 
end || ' expected: not equal' from rdb$database
union all
select case when 'Ä' = 'ä' collate unicode_ci then 'equal' else 'not equal' end 
|| ' expected: equal' from rdb$database
union all
select case when 'a' = 'à' collate unicode_ci_ai then 'equal' else 'not equal' 
end || ' expected: equal' from rdb$database
union all
select case when 'c' = 'ç' collate unicode_ci_ai then 'equal' else 'not equal' 
end || ' expected: equal' from rdb$database
union all
select case when 'é' = 'è' collate unicode_ci_ai then 'equal' else 'not equal' 
end || ' expected: equal' from rdb$database

delivers:

equal expected: not equal
equal expected: not equal
equal expected: equal
equal expected: equal
equal expected: equal
equal expected: equal


Is there something that can be done to improve this?


Regards

Stefan

-- 
Stefan Heymann, Tübingen, Germany







++

Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu.  Try FAQ and other links from the left-side menu there.

Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/ 

++


Yahoo Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/firebird-support/join
(Yahoo! ID required)

<*> To change settings via email:
firebird-support-dig...@yahoogroups.com 
firebird-support-fullfeatu...@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
firebird-support-unsubscr...@yahoogroups.com

<*> Your use of Yahoo Groups is subject to:
https://info.yahoo.com/legal/us/yahoo/utos/terms/