Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Event Calendar with DE and UTF-8


Go to End


5 Posts   2605 Views

Avatar
George

Community Member, 41 Posts

11 January 2010 at 4:48am

Hi UncleCheese,

my configuration:
Calendar::set_param('language','DE');
Calendar::set_param('timezone', 'Europe/Berlin');
CalendarDateTime::set_date_format('dmy');

with <?xml version="1.0" encoding="UTF-8"?> in page.ss.

The geman umlauts, for example März (March) are not shown correctly and the effect is that i get a 'XML Parsing Error: not well-formed' because März is handled as M￿r. I have no idea where to tackle it...

Thanks

Avatar
mathiasmex

Community Member, 28 Posts

11 January 2010 at 4:59am

Georg,

try to put

setlocale(LC_TIME,"de_DE.UTF-8");

in your mysite/config.php. At least worked for me.

mathiasmex

Avatar
George

Community Member, 41 Posts

11 January 2010 at 5:25am

I have revised this entry.

works now fine, thanks a lot.

Avatar
Pipifix

Community Member, 56 Posts

18 March 2011 at 3:33am

Edited: 18/03/2011 4:28am

Hello.

I use the tip of matthiasmex. This is problem still stand in my current silverstripe-insatllation. my _config.php looks like this.

i18n::set_locale('de_DE');
i18n::include_locale_file('event_calendar', 'de_DE');
i18n::include_locale_file('blog', 'de_DE');
setlocale(LC_ALL, 'de_DE');
setlocale(LC_TIME,"de_DE.UTF-8");

Its a strange thing that this umlautproblem only occurs on the monthselection (header above the calandartable) in the LiveCalendarWidget.
The translation of March is shown as "M�rz". The optionset below the table is working fine. No misspelled März.

I got no clue, where to track this error or to change the code effecting this.

Is there any array of translated months? Is this a javascriptthingy (eg. live_calendar_widget.js) ? Or is there a tricky line of code i've overlooked? (e.g CalendarDateTime.php).

Thanks for your help. Thomas

[Edit] It seems it effects only the $CalendarWidget and not the $LiveCalendarWidget.

Avatar
Lumpf

Community Member, 1 Post

10 November 2011 at 11:09am

Hi,

I also had the Umlaut problem. Finally I found the function i18n_date() in CalendarUtil.php. I changed it like this:

public static function i18n_date($char, $ts)
{
// Need to figure out how we're handling non- UTF-8 users.
return utf8_encode(strftime($char, $ts));
//return strftime($char,$ts);
}

This works for me.

Lumpf