title: Google calendar API: list events with '&" in summary
body: <p>Using google calendar v3</p>
  
  <p>Calendar has events with ampersands in the summary e.g. mother&amp;father
  Problem is that this is not found when using the Events:list q parameter from code.</p>
  
  <p>When using the API from this <a href="https://developers.google.com/calendar/v3/reference/events/list" rel="nofollow noreferrer">google API test page</a>, the behaviour is as follows:</p>
  
  <ul>
  <li>Searching for mother&amp;father results no events</li>
  <li>Searching for "mother&amp;father" (with quotes) returns the expected events</li>
  </ul>
  
  <p>When doing the same thing from code -with or without quotes- doesn't return the events. </p>
  
  <p>The code works fine when searching for events without ampersands in the summary.</p>
  
  <p>So question is: how can the q parameter be used from code, to retrieve events with ampersands in the name?</p>
  
  <p><strong>EDIT 17 Dec 2019: Provide more details</strong></p>
  
  <p>SET UP : google calendar with id , with an event on 19 dec 2019 with title "mother&amp;father child1"</p>
  
  <p>CASE1: Looking for "mother&amp;father", result ("items": look at the end of the response) is empty:</p>
  
  <pre><code>_api_list_args['q'] = 'mother&amp;father'
  GoogleConfig.service.events().list(**_api_list_args).execute()
  GET https://www.googleapis.com/calendar/v3/calendars/&lt;my_cal_id&gt;%40group.calendar.google.com/events?singleEvents=true&amp;q=father&amp;orderBy=startTime&amp;maxResults=8&amp;timeMin=2019-12-17T14%3A47%3A17.205463Z&amp;timeMax=2020-06-16T00%3A00%3A00.000Z&amp;alt=json
  {'kind': 'calendar#events',
   'etag': '"p334fb5lauquec0g"',
   'summary': 'SWD local',
   'updated': '2019-12-17T14:46:39.117Z',
   'timeZone': 'Europe/Brussels',
   'accessRole': 'writer',
   'defaultReminders': [],
   'items': []}
  </code></pre>
  
  <p>CASE2: Looking for "father", result is also empty:</p>
  
  <pre><code>_api_list_args['q'] = 'father'
  GoogleConfig.service.events().list(**_api_list_args).execute()
  URL being requested: GET https://www.googleapis.com/calendar/v3/calendars/&lt;my_cal_id&gt;%40group.calendar.google.com/events?singleEvents=true&amp;q=father&amp;orderBy=startTime&amp;maxResults=8&amp;timeMin=2019-12-17T14%3A47%3A17.205463Z&amp;timeMax=2020-06-16T00%3A00%3A00.000Z&amp;alt=json
  {'kind': 'calendar#events',
   'etag': '"p328ajglquuuec0g"',
   'summary': 'SWD local',
   'updated': '2019-12-17T14:51:41.818Z',
   'timeZone': 'Europe/Brussels',
   'accessRole': 'writer',
   'defaultReminders': [],
   'items': []}
  </code></pre>
  
  <p>CASE3: Looking for "child1", now it finds the event:</p>
  
  <pre><code>_api_list_args['q'] = 'child1'
  GoogleConfig.service.events().list(**_api_list_args).execute()
  URL being requested: GET https://www.googleapis.com/calendar/v3/calendars/&lt;my_cal_id&gt;%40group.calendar.google.com/events?singleEvents=true&amp;q=child1&amp;orderBy=startTime&amp;maxResults=8&amp;timeMin=2019-12-17T14%3A47%3A17.205463Z&amp;timeMax=2020-06-16T00%3A00%3A00.000Z&amp;alt=json
  {'kind': 'calendar#events',
   'etag': '"p338fbacsvauec0g"',
   'summary': 'SWD local',
   'updated': '2019-12-17T15:04:03.810Z',
   'timeZone': 'Europe/Brussels',
   'accessRole': 'writer',
   'defaultReminders': [],
   'items': [{'kind': 'calendar#event',
           'etag': '"3153190087620000"',
           'id': 'p939brcc2r83cu9q52sjagcua4_20191219T200000Z',
           'status': 'confirmed',
           'htmlLink': 'https://www.google.com/calendar/event?eid=cDkzOWJyY2MycjgzY3U5cTUyc2phZ2N1YTRfMjAxOTEyMTlUMjAwMDAwWiBnNXJ1cTl1Z2xlNWc2ZTFhMms1cmZyM2hjY0Bn',
           'created': '2019-11-29T16:58:45.000Z',
           'updated': '2019-12-17T15:04:03.810Z',
           'summary': 'mother&amp;father child1',
           'description': 'my nice description&lt;br&gt;&lt;a href="&lt;mysite&gt;" id="ow2358" __is_owner="true"&gt;&lt;mysite&gt;&lt;/a&gt;',
           'location': '#MYLOCATION',
           'creator': {'email': '&lt;myemail&gt;'},
           'organizer': {'email': '&lt;my_cal_id&gt;@group.calendar.google.com',
           'displayName': 'SWD local',
           'self': True},
           'start': {'dateTime': '2019-12-19T21:00:00+01:00', 'timeZone': 'Europe/Brussels'},
           'end': {'dateTime': '2019-12-19T22:00:00+01:00', 'timeZone': 'Europe/Brussels'},
           'recurringEventId': 'p939brcc2r83cu9q52sjagcua4',
           'originalStartTime': {'dateTime': '2019-12-19T21:00:00+01:00', 'timeZone': 'Europe/Brussels'},
           'iCalUID': 'p939brcc2r83cu9q52sjagcua4@google.com',
           'sequence': 0,
           'extendedProperties': {'shared': {'course_162': '1'}},
           'reminders': {'useDefault': True}}]}
  </code></pre>
  
  <p>BUT: This one also fails: look for "chil" ie part of a word...
  CASE 4: Look for "chil"</p>
  
  <pre><code>_api_list_args['q'] = 'chil'
  GoogleConfig.service.events().list(**_api_list_args).execute()
  URL being requested: GET https://www.googleapis.com/calendar/v3/calendars/&lt;my_cal_id&gt;%40group.calendar.google.com/events?singleEvents=true&amp;q=chil&amp;orderBy=startTime&amp;maxResults=8&amp;timeMin=2019-12-17T14%3A47%3A17.205463Z&amp;timeMax=2020-06-16T00%3A00%3A00.000Z&amp;alt=json
  {'kind': 'calendar#events',
  'etag': '"p338fbacsvauec0g"',
  'summary': 'SWD local',
  'updated': '2019-12-17T15:04:03.810Z',
  'timeZone': 'Europe/Brussels',
  'accessRole': 'writer',
  'defaultReminders': [],
  'items': []}
  </code></pre>
  
  <p><strong>Does google 'q' parameter only searches for whole words??</strong></p>