Great thanks!
When searching in the web, I only found some (obviously outdated) information that there would not exist reliable ways to check the UTF-8 bit.
So is_utf8() was exactly what I needed to circle in the problems'cause.
Turned out that HTTP::Tiny does not support Unicode, just raw text.
Thus the issue was resolved by UTF-8-encoding its byte string data through decode(). | [reply] |
Turned out that HTTP::Tiny does not support Unicode, just raw text.
That's correct. The statement in the documentation of HTTP::Tiny might deserve a more prominent representation:
Content data in the request/response is handled as "raw bytes". Any encoding/decoding (with associated headers) are the responsibility of the caller.
| [reply] |
Turned out that HTTP::Tiny does not support Unicode, just raw text.
HTTP has no concept of encoding. It's just a file transfer protocol.
By definition, text files don't have an encoding defined within, so HTTP headers can be used to communicate the encoding of the text file. But that doesn't mean that the HTTP agent should automatically decode the file. And it that doesn't apply to binary files such as XHTML. Even modern HTML is really a binary file.
| [reply] |