Change letter case problem for national characters

Discussion of open issues, suggestions and bugs regarding LiteDAC (SQLite Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
m227
Posts: 59
Joined: Mon 06 Aug 2007 12:41

Change letter case problem for national characters

Post by m227 » Sun 03 Jan 2016 19:38

Dear Sirs,
I try to do some usage of UPPER / LOWER functions. They unfortunately improperly change case of national characters, i.e.

Code: Select all

SELECT UPPER("sześć")
shall return

Code: Select all

SZEŚĆ 
but returns

Code: Select all

SZEść
So national characters are left unchanged. I tried to use Direct mode and Library mode with no change. I also checked "UseUnicode" with no change.
SQLite Manager plugin in Firefox gives proper result of UPPER/LOWER, so I assume this is not sqlite error itself. May be shall I change in any way my input string to unicode (if it is not)?
In reality it also fails when using comparison with

Code: Select all

COLLATE NOCASE
what I tried to use.

Could you propose any solution?
Michal

MaximG
Devart Team
Posts: 1019
Joined: Mon 06 Jul 2015 11:34

Re: Change letter case problem for national characters

Post by MaximG » Wed 06 Jan 2016 14:11

SQLite database does not support case-sensitive operations with National Character in the operators LIKE, UPPER, LOWER, etc. : Http://www.sqlite.org/faq.html#q18. To solve this problem, you can use SQLite International Components for Unicode Extension (https://www.sqlite.org/src/artifact?ci= ... README.txt), or override the operator UPPER (), implementing the user-defined function by using the TLiteUserFunction.

m227
Posts: 59
Joined: Mon 06 Aug 2007 12:41

Re: Change letter case problem for national characters

Post by m227 » Sun 10 Jan 2016 11:17

Thank you Maxim for clarification.
I was mislead by Firefox SQLite Manager add-in which any way makes proper conversion.

I used your solution with TLiteUserFunction and it works perfectly. I'm not sure what time penalty it produces but it is another story.

Michal

MaximG
Devart Team
Posts: 1019
Joined: Mon 06 Jul 2015 11:34

Re: Change letter case problem for national characters

Post by MaximG » Mon 11 Jan 2016 10:24

Thank you for your interest to our products. Feel free to contact us if you have any further
questions about LiteDAC.

Post Reply