Home  >  Q&A  >  body text

SQL query results are 0 when the string in the database row has a special font

I'm running this query:

SELECT id FROM posts WHERE title LIKE '%CERTIFIED INSTALLER%';

The text in the database is stored as 'ᴄᴇʀᴛɪꜰɪᴇᴅ ɪɴꜱᴛᴀʟʟᴇʀꜱ', which is a unique font.

The above query returns 0 results, but when I change the 'ᴄᴇʀᴛɪꜰɪᴇᴅ ɪɴꜱᴛᴀʟʟᴇʀꜱ' text font in the database to something like a sans serif font, it returns results.

Why is this?

P粉029327711P粉029327711404 days ago542

reply all(1)I'll reply

  • P粉165823783

    P粉1658237832023-09-12 10:51:00

    It's not a different font, it's a different character in Unicode.

    If you paste the text into https://www.babelstone.co.uk/Unicode/whatisit.html you will see it tells you what the characters actually are:

    U+1D04 : LATIN LETTER SMALL CAPITAL C
    U+1D07 : LATIN LETTER SMALL CAPITAL E
    U+0280 : LATIN LETTER SMALL CAPITAL R
    U+1D1B : LATIN LETTER SMALL CAPITAL T
    U+026A : LATIN LETTER SMALL CAPITAL I
    U+A730 : LATIN LETTER SMALL CAPITAL F
    U+026A : LATIN LETTER SMALL CAPITAL I
    U+1D07 : LATIN LETTER SMALL CAPITAL E
    U+1D05 : LATIN LETTER SMALL CAPITAL D
    U+0020 : SPACE [SP]
    U+026A : LATIN LETTER SMALL CAPITAL I
    U+0274 : LATIN LETTER SMALL CAPITAL N
    U+A731 : LATIN LETTER SMALL CAPITAL S
    U+1D1B : LATIN LETTER SMALL CAPITAL T
    U+1D00 : LATIN LETTER SMALL CAPITAL A
    U+029F : LATIN LETTER SMALL CAPITAL L
    U+029F : LATIN LETTER SMALL CAPITAL L
    U+1D07 : LATIN LETTER SMALL CAPITAL E
    U+0280 : LATIN LETTER SMALL CAPITAL R
    U+A731 : LATIN LETTER SMALL CAPITAL S

    Take "ᴄ" as an example, you can look it up elsewhere, such as at https://symbl.cc/en/1D04/, it tells us:

    You can see that the standard capital letter C is actually another character in Unicode called "Latin Letter Capital C", https://symbl.cc/en/0043/:

    This also means that your database (and table) uses a character set that supports the Unicode characters you show here.

    reply
    0
  • Cancelreply