I realise that we've had a very long recent thread about Unicode...sorry if this drags the issue out further! However, I have little understanding of Unicode, and I rarely needed to know. But I could do with some help, please...
My partner runs a dog care business and I have built the booking platform for her. Part of this provides a URL to Google Calendar to update our mobile calendars from the booking system. This all works fine but I'll ask a couple of more general questions at the end.
I decided it would be nice to have a Dog Face Emoji as the first character of the title of the calendar entry. But I cannot get this to display. The script uses Template to generate the ICS feed for Google Calendar.
BEGIN:VCALENDAR VERSION:2.0 PRODID:Pawsies Calendar 1.0//EN CALSCALE:GREGORIAN METHOD:PUBLISH [% FOREACH event IN day %]BEGIN:VEVENT SUMMARY:\x{e052} [% event.type %][% IF event.dog %] - [% event.dog %][ +% END %] [% IF event.note %]DESCRIPTION: [% event.note %] [% END %]UID:pawsies[% event.idBooking %][% event.id %]@pawsies.uk SEQUENCE:[% event.sequence %] DTSTAMP:[% event.dtstart %] DTSTART:[% event.dtstart %] DTEND:[% event.dtend %] URL:https://www.pawsies.uk/admin/calendar/?day=[% event.date %] COLOR:[% event.color %] END:VEVENT [% END %]END:VCALENDAR
Everything works as expected except the emoji is printed as a literal \x{e052} instead of a 🐶 - I have use utf8; at the top of the script and the HTTP Header is:
Content-type: text/calendar; charset=utf-8
A couple of extra questions if you are experienced at feeding data to Google Calendar:
1 - Is it possible to force Google to refresh the feed? Waiting for 24 hours or so makes debugging slow and tedious.
2 - Is it possible to set the colour of the event from the ICS feed so we can have multiple colours from one feed? Currently, we have two feeds just to get two different colours. I've tried the COLOR property but it seems to be ignored.
Updated to correct MIME type
In reply to Another Unicode/emoji question by Bod
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |