View Full Version : Invalid/incorrect UTF-8 encoding in calendar
I've selected Swedish as my language and tried a setting of both "sv" and "sv_SE" in the site wide settings. Regardless, the day names in the calendar are displayed incorrectly.
In Sweden, monday, saturday, and sunday have national characters in them (måndag, lördag, and söndag); they are not displayed properly. I've tried it in Firefox 1.04 and MSIE 6sp1.
This is DP 2.01.
Firefox says the page is UTF-8 encoded.
You can try change file calendar.class.php
line number 262
$s .= "\n\t\t<th width=\"14%\">" . htmlentities(utf8_encode($day), ENT_COMPAT, $locale_char_set) . "</th>";
$s .= "\n\t\t<th width=\"14%\">" . htmlentities($day, ENT_COMPAT, $locale_char_set) . "</th>";
I also had the same problem, utf8 support is not mature in dP (IMHO). Anyway, you should have got your localization translation strings (about dates) in your Translation Management under System.
You must make a few changes in your source code to get it working...
(252) global $locale_char_set, $AppUI;
(262) $s .= "\n\t\t<th width=\"14%\">" . htmlentities($AppUI->_($day), ENT_COMPAT, $locale_char_set) . "</th>";
other nice change
(229) $s .= htmlentities($AppUI->_($this->this_month->format("%B") ) . " " . $this->this_month->format("%Y"), ENT_COMPAT, $locale_char_set);
I have the same problem. But, your proposal is not working well.
I had the same problem...
But thanks, Krot. it worked, nicely.
20-07-05, 05:51 PM
Actually, with Japanese, and I am assuming also Chinese and Korean, using htmlentities breaks the display, and you get garbage. It worked fine to remove the htmlentities call, which I did both in calendar.class.php, and also in the allocatedusers.php report file, which had the same issue. I will probably find the problem in a couple of other places as well...
vBulletin® v3.6.4, Copyright ©2000-2013, Jelsoft Enterprises Ltd.