Index character for multibyte string

Re: Index character for multibyte string

by Daniel Mikšík -
Number of replies: 0
Picture of Core developers Picture of Translators

I was getting strange index letters when moving to Unicode in Czech; what helped in my case was modifying the following line in mod/glossary/view.php (approx. line no. 340):

original line: $pivot = $pivot[0];

modified line: $pivot = mb_substr($pivot, 0, 1, get_string("thischarset","moodle"));

You may try experimenting with the fourth parameter (encoding) in mb_substr, if the proposed solution doesn't work right away.

Hope this helps.

Dan