CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Discussion »
  • Internationalization and Localization (Moderators: Michał Mach, mathieu) »
  • Diacritics breaks order and search
Pages: [1]

Author Topic: Diacritics breaks order and search  (Read 1034 times)

elaborator

  • I’m new here
  • *
  • Posts: 3
  • Karma: 0
  • CiviCRM version: CiviCRM 4.4
  • CMS version: Drupal 7
  • MySQL version: MySQL 5.1
  • PHP version: PHP 5.3
Diacritics breaks order and search
December 09, 2013, 01:25:03 pm
Last year, I reported a bug (CRM-10379)[1] regarding the search function not discriminating between letters with different diacritics.

Example: The search term "åhl" returns both surnames "Ahl" and "Åhlberg" where only the latter is a proper search hit in Swedish.

Some other languages are more liberal regarding those rings and umlauts, thus just treats most diacritics as variants of the basic letter. However Scandinavian languages do not. Å, Ä, Ö, Æ and Ø are considered distinct letters, while most foreign accents (to us) such as É and Ô are treated as variants of the main letter. Complicated, yes - but it should not really be much of a concern to CiviCRM as long as it entrusts these issues to MySQL, as it is capable of doing the right thing with these diacritics when given the chance.[2]

Until very recently (up to version 4.4.2), a heavy handed hack worked sufficiently. I just changed the collation of every table from utf8_general_ci to utf8_swedish_ci without any visible problems. Both searches and the order of names showed up just as expected. This hack was of course bound to break some day. However, I hoped that the bug I reported would be fixed before this hack became ineffective. Now this unresolved bug has finally caught up with me. That fix I used now breaks the Quick Search function. I just wanted to raise this issue with the developers once again.

[1] http://issues.civicrm.org/jira/browse/CRM-10379
[2] http://collation-charts.org/mysql60/mysql604.utf8_swedish_ci.html
« Last Edit: December 09, 2013, 01:32:14 pm by elaborator »

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Diacritics breaks order and search
December 09, 2013, 05:01:17 pm

any idea why the fix you used breaks in 4.4?

i dont know what a good solution to this issue is, i'll see of some of our i18n folks will take a look

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

mathieu

  • Administrator
  • Ask me questions
  • *****
  • Posts: 620
  • Karma: 36
    • Work
  • CiviCRM version: 4.7
  • CMS version: Drupal
  • MySQL version: MariaDB 10
  • PHP version: 7
Re: Diacritics breaks order and search
December 09, 2013, 06:09:13 pm
Hi,

If you can check in your CiviCRM log (in template_c/ConfigAndLog/), there should be a log of the query that failed. It is probably related to a "join" between two tables of different 'collate'. For example, if you create a new custom group, you need to change the collate of the resulting new mysql table. Another option, might be caused by temporary tables. Just an assumption, of course, and you may have already checked that, but the log should have the answer.

Any thoughts on how other systems handle the collate issue? For example, we could have an extension that would take care of ensuring that the collate corresponds to the one set by the administrator.

Mathieu
CiviCamp Montréal, 29 septembre 2017 | Co-founder / consultant / turn-key CiviCRM hosting for Quebec/Canada @ SymbioTIC.coop

elaborator

  • I’m new here
  • *
  • Posts: 3
  • Karma: 0
  • CiviCRM version: CiviCRM 4.4
  • CMS version: Drupal 7
  • MySQL version: MySQL 5.1
  • PHP version: PHP 5.3
Re: Diacritics breaks order and search
December 10, 2013, 03:11:12 pm
Thank you! I'll check the logs and report back to this thread in a few days.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Discussion »
  • Internationalization and Localization (Moderators: Michał Mach, mathieu) »
  • Diacritics breaks order and search

This forum was archived on 2017-11-26.