Alphabar (and path for initial page, ets.) for non Latin letters
Pozniy - December 22, 2006 - 20:54
| Project: | G2 Glossary |
| Version: | 4.7.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | fgm |
| Status: | closed |
Jump to:
Description
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?

#1
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 throughurlencodeto 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.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_initialand_g2_initialwork 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: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_alphabarin your theme file: this will allow you to try different looks for the alphabar without messing with the module itself.#2
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.
#3
Another variant: URLs like %d0%94 work correctly with both clean and not clean URLs.
#4
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.
#5
#6
Slight change today, to cover the case of terms with a "/" in them.
#7
No comments in over 3 months, closing.
#8