frellan03/03/2023, 2:07 PM
header instead of the
which it had before. This causes my flutter app to display the wrong characters since it decodes everything all wrong. How do I fix this? Why is this change not documented? My entire API is broken.
Content-Type: application/json; charset=UTF-8
Sam03/03/2023, 2:17 PM
isn’t a valid content type header. See also https://youtrack.jetbrains.com/issue/KTOR-3799
frellan03/03/2023, 2:19 PM
Sam03/03/2023, 2:19 PM
frellan03/03/2023, 2:24 PM
on every single thing instead of
Sam03/03/2023, 2:32 PM
takes a String, which has already been decoded (using, potentially, the wrong encoding). Ideally there would be a method that takes the bytes and decodes them directly to JSON, without needing to go via a String.
frellan03/03/2023, 2:33 PM
Sam03/03/2023, 2:39 PM
When no explicit charset parameter is provided by the sender, media subtypes of the “text” type are defined to have a default charset value of “ISO-8859-1"which is not only obsolete but also specifically doesn’t apply to application/json. That said, it’s a reasonable default if the user specifically wants to get the body as a String.
directly to a JSON decoder of some kind? That might avoid the problem.
frellan03/03/2023, 2:41 PM
solves it for me