Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4244954
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T03:46:34+00:00 2026-05-21T03:46:34+00:00

In SQLite I want to case-insensitive SELECT LIKE name works fine for normal latin

  • 0

In SQLite I want to case-insensitive "SELECT LIKE name"
works fine for normal latin names, but when the name is in UTF-8 with non-latin characters then the select becomes case-sensitive, how to make it also case-insensitive like latin characters?

p.s. my sqlite is v3 and I connect with PHP PDO

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T03:46:35+00:00Added an answer on May 21, 2026 at 3:46 am

    For SQLite you have 2 options:

    1. compile it with ICU support: How to compile, Compilation options
    2. override the LIKE function, here is a complete solution (from http://blog.amartynov.ru/?p=675)
    $pdo = new PDO("sqlite::memory:");
    
    # BEGIN
    
    function lexa_ci_utf8_like($mask, $value) {
        $mask = str_replace(
            array("%", "_"),
            array(".*?", "."),
            preg_quote($mask, "/")
        );
        $mask = "/^$mask$/ui";
        return preg_match($mask, $value);
    }
    
    $pdo->sqliteCreateFunction('like', "lexa_ci_utf8_like", 2);
    
    # END
    
    $pdo->exec("create table t1 (x)");
    $pdo->exec("insert into t1 (x) values ('[Привет España Dvořák]')");
    
    header("Content-Type: text/plain; charset=utf8");
    $q = $pdo->query("select x from t1 where x like '[_РИ%Ñ%ŘÁ_]'");
    print $q->fetchColumn();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm querying an SQLite database using NHibernate. Generally, I want to do case insensitive
I want to select records from sqlite3 database by string matching. But if I
I want to increment a column in a sqlite android database. Im doing like
I want to ship a default SQLite database, with some predefined key/value pairs in
I want to store a row in an SQLite 3 table for each booking
I've got a C++ program that uses SQLite. I want to store the SQL
I like how SQLite library can be included into an application and the application
I'm using SQLite with PHP and I want to know if my query failed
I developed one database related application for iPhone device(SQlite database). Now i want to
I have a simple client-side Sqlite database (via. Google Gears) I want to use

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.