Page 1 of 1

Change letter case problem for national characters

Posted: Sun 03 Jan 2016 19:38
by m227
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

Re: Change letter case problem for national characters

Posted: Wed 06 Jan 2016 14:11
by MaximG
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.

Re: Change letter case problem for national characters

Posted: Sun 10 Jan 2016 11:17
by m227
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

Re: Change letter case problem for national characters

Posted: Mon 11 Jan 2016 10:24
by MaximG
Thank you for your interest to our products. Feel free to contact us if you have any further
questions about LiteDAC.