Jump to content

Collation Issue?


friedemann_bach

Recommended Posts

Dear phpfreaks,

 

I am working on a database that contains Arabic translations of Greek words. Having to operate with diacritics and vowels, I set all MySQL collations to utf8_unicode_ci. This works very good for Greek, as users can enter any diacritics combination (sometimes up to three on a single letter). It does not work at all for Arabic vowels, though.

 

A request that includes no vowels, like

 

SELECT * FROM vocabulary WHERE arabic_lexeme LIKE 'سبب'

 

should return at least the same results as as a request with vowels, like

 

SELECT * FROM vocabulary WHERE arabic_lexeme LIKE 'سَبَبٌ'

 

but it doesn't. I have two entries that match 'سَبَبٌ', and ... LIKE 'سبب' does not match them.

 

I imagined that it would work like French accents or German umlauts. Maybe I am wrong here?

 

To exclude any errors that are based on my php coding, I have tested the same queries in phpMyAdmin.

I also tried with different collations, cp1256_general_ci and utf8_general_ci.

I am still not able to search for Arabic words with "insensitive vowels".

 

I would appreciate any help or comments on this problem.

Thank you very much for your attention!

 

Link to comment
https://forums.phpfreaks.com/topic/232310-collation-issue/
Share on other sites

  • 2 weeks later...

I've found out by chance that both

 

SELECT * FROM vocabulary WHERE arabic_lexeme = 'سبب'

 

and

 

SELECT * FROM vocabulary WHERE arabic_lexeme = 'سَبَبٌ'

 

return as well the results with vowels as without vowels.

 

Thought that it would work similar to Greek accents (with LIKE) ... but obviously it does not.

 

Thanks for your help!

 

Link to comment
https://forums.phpfreaks.com/topic/232310-collation-issue/#findComment-1202043
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.