PDA

View Full Version : Invalid/incorrect UTF-8 encoding in calendar


joho
18-05-05, 12:18 AM
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.

Krot
31-05-05, 03:55 PM
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>";

on

$s .= "\n\t\t<th width=\"14%\">" . htmlentities($day, ENT_COMPAT, $locale_char_set) . "</th>";

aleiva
31-05-05, 10:17 PM
Hi !

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...


calendar.class.php

(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

calendar.class.php

(229) $s .= htmlentities($AppUI->_($this->this_month->format("%B") ) . " " . $this->this_month->format("%Y"), ENT_COMPAT, $locale_char_set);


Be happy.

Wojtek
26-06-05, 02:15 AM
Hi.
I have the same problem. But, your proposal is not working well.
Another proposal?
Cheers.
Wojtwk

PidStu
19-07-05, 12:56 AM
I had the same problem...
But thanks, Krot. it worked, nicely.

nfrengle
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...