ps: the above changes is for line 302 in mctagmap.php
Birgir,
Can you please post a link to a page that this is working on? My solution so far has quite a few more lines of code behind it.
Thanks
Hi, I use the shortcode
[mctagmap columns="4" more="meira »" hide="no" num_show="4" toggle="«" show_empty="no" name_divider="|" tag_count="yes"]
on this new Icelandic webpage: http://60plus.is/stikkord/
and this works well for the Icelandic characters (for example: Á, Æ)
Interesting. Can you do me one more favor? Can you make a sample tag that begins with Þ so I can see if it renders that correctly?
Have now tested (Á, Æ, Þ, Â, ß, ç) and its seems to work OK
… and tried some Chinese symbols (汉,語) – they work as well
awesome, thanks.
I’ll use that in the update. It’s a lot simpler than what I was working on.
At least it is working for the basic shortcode version
in WP version 3.2.1 with PHP5.
I just uploaded the plugin today, so I haven’t tested all the features 😉
The PHP must also have a support for multibyte string functions:
– http://www.php.net/manual/en/mbstring.supported-encodings.php
– http://www.php.net/manual/en/book.mbstring.php
ps: thanks for your nice plugin
Yeah, I was testing this:
$first_letter = ucfirst(mb_convert_encoding(htmlentities($tag->name, ENT_NOQUOTES, 'UTF-8'), "ISO-8859-15", "UTF-8"));
but, it didn’t handle Þ and Cyrillic so I was using more lines to determine what letter it was trying to be.
So for locally your simpler way is working.
I’m working on another addition as well and when I get that done, I’ll release a new one.
Thanks again
p.s. sorting by language is going to be tougher. That’s for later 😉
Here is my fix/hack to get the right language order:
Instead of the line
ksort($groups);
one could use
if(strlen(WPLANG)>0){
setlocale(LC_COLLATE,WPLANG'.UTF-8');
}
uksort($groups,'strcoll');
where I’m using the language-option in wp-config.php
define ('WPLANG', 'is_IS');
to figure out what kind of encoding the user wants 😉
This hack is working for my setup.
missing dot:
setlocale(LC_COLLATE,WPLANG.'.UTF-8');
Maybe it is better to put it above the loops and preserve the current locale:
$current_locale=setlocale(LC_COLLATE, '0');
if(strlen(WPLANG)>0){
setlocale(LC_COLLATE,WPLANG.'.UTF-8');
}
and the after the loops:
setlocale(LC_COLLATE,$current_locale);
cheers 😉