assumeUtf8 property

bool assumeUtf8
final

Assume utf8 within in response bodies.

The response of current gitlab instances (checked with 12.7.0-pre) respond without specifying the encoding of the response within the content-type (the server responds with content-type: application/json).

The default implementation of http Response does assume latin1 in such cases. Therefore any special characters are broken.

In order to avoid this behavior, the utf8 charset, which actually is used by gitlab, will be appended to the content-type, thus the resulting header is content-type: application/json; charset=utf-8 and will be parsed correctly.

This behavior is enabled by default, but one can disable it, because this field is introduced in a later version (v0.5.0) and might interfere with existing implementations.

Implementation

final bool assumeUtf8;