Accented chars

23 views
Skip to first unread message

John vd Waeter

unread,
May 2, 2021, 6:03:31 PM5/2/21
to firebird-support

Hi All,
I have a keyword-table with fields:
ID,
Displayed_text, (UTF-8)
Searchedfor_text (UTF-8)

As the names say, displayed_text is used to display the keyword, Searchedfor_text is the indexes column in uppercase.
A trigger fills the Searchedfor_text whenever a new Displayed_Text is inserted or updated, like new.SearchedFor_text = upper(new.displayed_text);

This works great, but it doesn't cover accented characters, as I like to catch Café when a user types cafe.

Does firebird have a function to translate Café to Cafe?
Or does anyone know of an external function who does the job?

Thanks in advance,
John

Lucas Schatz

unread,
May 2, 2021, 6:08:20 PM5/2/21
to firebird-support

Ariel Álvarez

unread,
May 2, 2021, 10:05:41 PM5/2/21
to firebird...@googlegroups.com
COLLATE UNICODE_CI_AI is what you are looking for


Regards,
Ariel

--
You received this message because you are subscribed to the Google Groups "firebird-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebird-suppo...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/firebird-support/bee3de9c-a483-482d-92da-52c6975c501fn%40googlegroups.com.

liviuslivius

unread,
May 3, 2021, 2:23:34 AM5/3/21
to firebird...@googlegroups.com
You got an answer but you do not need second field and trigger for that purpose. Look at expression index.

Regards,
Karol Bieniaszewski


-------- Oryginalna wiadomość --------
Od: John vd Waeter <johnvand...@gmail.com>
Data: 03.05.2021 00:03 (GMT+01:00)
Do: firebird-support <firebird...@googlegroups.com>
Temat: [firebird-support] Accented chars

Mark Rotteveel

unread,
May 3, 2021, 3:17:52 AM5/3/21
to firebird...@googlegroups.com
On 03-05-2021 00:08, Lucas Schatz wrote:
> Take a read at collations here:
> https://firebirdsql.org/refdocs/langrefupd25-collations.html

That is a link to the Language Reference Update, the complete Language
Reference has a more complete list:
https://www.firebirdsql.org/file/documentation/html/en/refdocs/fblangref25/firebird-25-language-reference.html#fblangref25-appx06-charsets
(Firebird 2.5)

or
https://www.firebirdsql.org/file/documentation/html/en/refdocs/fblangref30/firebird-30-language-reference.html#fblangref30-appx07-charsets
(Firebird 3.0)

Mark
--
Mark Rotteveel

Mark Rotteveel

unread,
May 3, 2021, 3:19:54 AM5/3/21
to firebird...@googlegroups.com
On 03-05-2021 08:23, liviuslivius wrote:
> You got an answer but you do not need second field and trigger for that
> purpose. Look at expression index.

You don't even need an expression index if you define the field with the
right collation (assuming you want comparisons of that field to default
to that collation). Then a normal index suffices.

Mark
--
Mark Rotteveel

Mark Rotteveel

unread,
May 3, 2021, 3:21:07 AM5/3/21
to firebird...@googlegroups.com
On 03-05-2021 04:05, Ariel Álvarez wrote:
> COLLATE UNICODE_CI_AI is what you are looking for
>
> https://ib-aid.com/download/docs/firebird-language-reference-2.5/datatypes-chartypes.html
> <https://ib-aid.com/download/docs/firebird-language-reference-2.5/datatypes-chartypes.html>

Be aware, the link you use is from an older version of the Firebird 2.5
Language Reference. The latest version is at
https://www.firebirdsql.org/file/documentation/html/en/refdocs/fblangref25/firebird-25-language-reference.html#fblangref25-datatypes-chartypes

Mark
--
Mark Rotteveel

John vd Waeter

unread,
May 3, 2021, 3:24:42 AM5/3/21
to firebird-support
Guys, you've made my day!
Thanks a lot!
Cheers,
John

Tim Crawford

unread,
May 3, 2021, 9:04:32 AM5/3/21
to firebird-support
I played with this method (collation unicode_ca_ai)  recently and it is excellent, however you have to be aware if maximum index sizes due to the length used by the Unicode chars (one index was compound and three errors on index create)

Tim Crawford

Reply all
Reply to author
Forward
0 new messages