packages-http
packages-http copied to clipboard
http_open does not comply to explicitly set reply encoding
Currently http_open/3 does not seem to comply to the encoding set by the Content-Type reply header. While the encoding is claimed to be UTF-8, the content clearly contains incorrect characters (for non-ASCII Unicode characters):
?- http_open('https://api.test.triply.cc/info', _In, [header(content_type,ContentType)]),
json_read_dict(_In, Dict),
stream_property(In, encoding(Enc)).
ContentType = 'application/json; charset=utf-8',
Dict = _22402{branding:_20790{description:"Linking Business to Datað\237\\221\ª", ...
Enc = octet.
Expected: The encoding of stream In to automatically be set based on the value of the Content-Type reply header.