Most of my glossary terms are in non Latin and I would like an alphabar to display non Latin characters. Currently it is set to display letters 'a'->'z' and non-working initial page path (example: "... ?q=g2/initial/%25D1%258F" and
"Entries starting by initial %D1%8F
Displaying 0 entries starting by '%D1%8F' from a total number of 1 entries.
Admin info: there are also 0 unpublished matching entries from a total number of 0 unpublished entries.
" instead sub-list of terms).

How do I change this?

Comments

fgm’s picture

Category: bug » support
Status: Needs work » Postponed (maintainer needs more info)

Hi,

The problem seems to be twofold. As you surmised, G2 was written with Latin-1 in mind, and more generally should work "out of the box" only with character sets within the Unicode Basic Multilingual Plane.

  • _g2_alphabar() which generates the alphabar, processes each initial through urlencode to avoid generating characters with specific meaning in an URL like amperstands or question marks. This is why you see %25D1%258F : these URLs seem to be proper. If I type я in the firefox address bar, it get rewritten as %D1%8F, for instance.
  • the URLs you pass to Drupal for G2 are processed first when generating the page by the G2 theme function theme_g2_initial() : if I try either http://www.riff.org/g2/initial/я or http://www.riff.org/g2/initial/%D1%8F, or http://www.riff.org/g2/initial/%25D1%258F as you suggest in your example, after adding a fictitious entry яяяя to my G2 and the я symbol in the alphabar, G2 correctly returns an initial page for я: it does not display "...starting by '%D1%8F' from..." but (the french equivalent of) "...starting by 'я' from ...", which seems correct to me.

Can you try a few samples of the URLs you obtain on my site, so we can ascertain whether theme_g2_initial and _g2_initial work correctly ? It seems to me as if they were working on my site, but not on yours, which might point to one of two problems:

  • maybe you are not using the proper version of the 4.7 module : current version is 1.15.2.10
  • maybe your PHP is missing some Unicode support. Can you provide a link to your phpinfo() page ?

You can also contact me directly using the contact form or (as "osinet") on #drupal, #drupal-support, #drupal-ecommerce or #php-gtk so we can discuss this interactively: my setting being latin-1, I may not be able to reproduce your problem and we may need to perform tests together.

Before trying to fix the module itself, I also suggest you try to override theme_g2_alphabar in your theme file: this will allow you to try different looks for the alphabar without messing with the module itself.

fgm’s picture

Assigned: Unassigned » fgm
Status: Postponed (maintainer needs more info) » Active

The URLs like %25d0%2594 are normal and work normally on a fully configured site with clean URLs.

However, the problem appears when clean URLs are not activated. In this case, G2 receives an improper path.

fgm’s picture

Another variant: URLs like %d0%94 work correctly with both clean and not clean URLs.

fgm’s picture

Category: support » feature
Status: Active » Fixed

Features supporting this type of scenario have been added in 1.15.2.11.

The problem detailed in http://drupal.org/node/105067 is not covered, since G2 no longer generates this type of URLs.

Anonymous’s picture

Status: Fixed » Closed (fixed)
fgm’s picture

Status: Closed (fixed) » Needs review

Slight change today, to cover the case of terms with a "/" in them.

fgm’s picture

Status: Needs review » Fixed

No comments in over 3 months, closing.

Anonymous’s picture

Status: Fixed » Closed (fixed)