0

I heard that you need to enable enable-sqlite-utf8, but I could not find this line anywhere in xampp or the documentation, how to enable full utf8 support in pdo_sqlite extension in xampp (windows)?

But I guess that I'm wrong there and enable-sqlite-utf will not enable correct unicode LIKE operator with non ASCII characters, for it to work I think I need to enable ICU for sqlite in XAMPP, but how?

ie: I can't get #18 to work http://www.sqlite.org/faq.html#q18

Timo Huovinen
  • 53,325
  • 33
  • 152
  • 143
  • Isn't it enabled by default? Did you try using an sqlite db? – Mārtiņš Briedis Feb 08 '11 at 12:38
  • I don't think it is enabled, if it was, unicode chars should be case-insensitive in the LIKE operator that I'm using. – Timo Huovinen Feb 08 '11 at 12:41
  • I noticed the comment "intl has the icu sqlite extension" in the php.ini file in xampp, where extension=php_intl.dll is enabled, I wonder how to actually have ICU work? googling for "xampp ICU" brings up this very same question. – Timo Huovinen Feb 08 '11 at 14:30

1 Answers1

2

http://www.sqlite.org/lang_expr.html

The LIKE operator is case sensitive by default for unicode characters that are beyond the ASCII range. For example, the expression 'a' LIKE 'A' is TRUE but 'æ' LIKE 'Æ' is FALSE.)

You can however use the ICU extension for sqlite to get this functionality, see also #611459.

Community
  • 1
  • 1
igorw
  • 27,759
  • 5
  • 78
  • 90
  • I know that, What I want to know is HOW to enable ICU for sqlite in xampp? – Timo Huovinen Feb 08 '11 at 12:56
  • Look at the second answer of the question I linked to. And additional information here: http://www.sqlite.org/cvstrac/wiki/wiki?p=LoadableExtensions – igorw Feb 08 '11 at 13:00
  • Second answer suggests I compile with gcc (reading from other questions it's actually g++), also I'm on Windows and have no clue how to compile. – Timo Huovinen Feb 08 '11 at 14:35
  • Another way to get the LIKE function to work is answered here: http://stackoverflow.com/questions/4285396/case-insensitive-utf8-select – Timo Huovinen Apr 11 '11 at 08:00
  • 1
    @TimoHuovinen: Beware with that function as it won't be called if you use an escape character. Check my improved version: http://stackoverflow.com/a/19749906/89771. – Alix Axel Nov 03 '13 at 04:48