-
Notifications
You must be signed in to change notification settings - Fork 474
Open
Description
When we submit a form with Turbo, the response is always decoded as UTF-8, even though the response has a different charset:
> Content-Type: text/html; charset=Windows-1252
The issue with this approach, is that responses encoded in another encoding will have issues with the decoded content.
The root cause is that Response.text() always returns a UTF-8 decoded string, which is being used in src/http/fetch_response.js - get responseHTML to decode the response.
I am unsure if this is also the intended behaviour in Turbo, but I believe it would be safe to implement a TextDecoder that respects the response charset.
I've created a small example where I use a TextDecoder to decode the response in the response charset
d3e9996
Metadata
Metadata
Assignees
Labels
No labels