Persian locale causes invalid time values in iCalendar/vCard

  • developer

    Regarding events: The debug info #1 shows a parsing error:

    at.bitfire.ical4android.InvalidCalendarException: Couldn’t parse iCalendar
    Caused by: Error at line ۱۰:Invalid ID for ZoneOffset, non numeric characters found: +۰۳۳۰

    which means that the invalid event has been received (not sent) by DAVx5.

    How did you generate the event?

    Regarding contacts: Here it really looks like DAVx5 generates those invalid dates, but I don’t have an idea why and I can’t reproduce it yet. I have done the three steps from above, but DAVx5 doesn’t generate those localized dates here.

  • developer

    I can’t reproduce the problem at all (Nextcloud 20, Android 10 emulator). Even if I set both to Persian and create and modify events and contacts, no problem. Also I don’t have an idea how such a problem could occur.

    Also, I think if this problem would generally occur with Persian locale, we would already have got a report.

    Since when does this problem occur? Did you have a working installation before?

  • developer

    In the debug info, your locale is:

    │ locale │
    │ fa_IR  │

    In my testing debug info, it’s:

    │ locale           │
    │ fa_IR_#u-nu-latn │

    (But I don’t understand the Persian language or signs ☹️, so I don’t know which variant I have actually selected.)

    That’s interesting, because “u-nu-latn” sounds like a variant with latin numbers, which could be related to the problem.

    How did you set your locale und to which exact value (as you see it in your Android settings, original language)? (If you have multiple locales, please provide all values and how you have set them)

  • @rfc2822 I’m not able to read Farsi, but I’ve searched the Internet for related locale problems and found the following information which might help you understanding/solving this issue:

  • developer

    Ah forget it, I could reproduce the problem. There are different variants in the Android locale settings:

    1. Persian (Iran) – ایران (?) → problem occurs
    2. Persian (Iran) western digits – ایران (ارقام غربی) (?) → no problem

    and two others which I don’t understand (yet).

    So the question is why ez-vcard and ical4j generate localized numbers (instead of ASCII numbers) when the first locale is selected. Maybe some system function generates them…

    @danialbehzadi Can you confirm that it works as expected with “Iran (western digits)”?

  • developer

    This post is deleted!
  • developer

    @danialbehzadi Thanks for the report. I think I have found the problem now and will do further research and report it to the respective libraries. Until then, please use the “western digits” variant on your Android device.

  • @rfc2822
    I confirm that it works fine under Western digits variant of Persian. But everything with numbers looks ugly now 😁

  • developer

    @danialbehzadi Yes, that won’t be necessary as soon as this is fixed. Unfortunately it’s not directly in the DAVx5 code, but in used libraries.


    Similar problem:

  • I faced with this issue for calendar. I had my calendar synced with Nextcloud. In one of the calendars, I added an event on my phone (which uses Persian language) and set reminder. Thereafter, I had sync issue.

    Today I looked at the .ics file and saw this:


    You can clearly see on TRIGGER line, there are Persian numbers.

    I manually edited the file and made a new calendar on Nextcloud. It is working fine now.

    Just the point is title or description shouldn’t be modified. Only those lines should be modified which use number for some calculation.

Similar topics

  • 9
  • 1
  • 10