Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
Show all 6 items in the list
Tags used for linking issues. [ID: 1172495]
View issue level access limits(Press Alt + Right arrow for more information)
Unintended behavior
View staffing
Description
Description
If the
/batch/gmail/v1
path is used to batch multiple GET requests, the JSON objects in the response show gibberish characters, e.g.ü
, in the subject and snippet where it is expected to see an accented letter such as Germanü
.Meanwhile, when sending an individual request, e.g.
GET /v1/users/me/messages/{message id}?format=full
, the returned JSON shows the correct snippets and subject, with international alphabet showing correctly!Batching Requests
Code
Prepare multiple content parts, each with Content-Type "application/http", encoding UTF-8 and body comprising of the verb, endpoint and content (if applicable). Send the multipart content to the batch endpoint.
Output
Among multiple parts, here is a substring. Notice
Ich heiÃe...
andFrage bezüglich des verfügbaren Zimmers
and their expected correct output in the next section.Individual Requests
Code
Prepare and send a normal GET request to the resource endpoint.
Output
Here is a part of the response content as string, displaying the German letters correctly without having to make any modification to the string yet.
In that case, the user does not worry about the transfer encoding or such characters because the JSON response is UTF-8 and the backend code has already parsed the best practice ) should the text be encoded in the multipart as it is in the individual requests.
=?utf-8?q?....?=
and all that stuff from the raw content. However, optimizing the network usage was going to be a great advantage of this batched requests service handler (and also recommended by the Gmail API Guide as aRemarks
messages
as well asthreads
for all?format={x}
values except 'raw' (e.g. full, metadata, minimal) as it is reflected on thesnippet
field and theSubject
header value. That being said, it could also occur for a sender's name if it uses non-ASCII characters, such as 'Hans Müller'.