Jump to:

10979 Posts in 2722 Topics by 1815 members

All other Modules

SilverStripe Forums » All other Modules » Event Calendar with DE and UTF-8

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 1823 Views
  • George
    Avatar
    Community Member
    41 Posts

    Event Calendar with DE and UTF-8 Link to this post

    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

  • mathiasmex
    Avatar
    Community Member
    28 Posts

    Re: Event Calendar with DE and UTF-8 Link to this post

    Georg,

    try to put

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

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

    mathiasmex

  • George
    Avatar
    Community Member
    41 Posts

    Re: Event Calendar with DE and UTF-8 Link to this post

    I have revised this entry.

    works now fine, thanks a lot.

  • Pipifix
    Avatar
    Community Member
    54 Posts

    Re: Event Calendar with DE and UTF-8 Link to this post

    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.

  • Lumpf
    Avatar
    Community Member
    1 Post

    Re: Event Calendar with DE and UTF-8 Link to this post

    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

    1823 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.