Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New endpoints:
/encoding/<charset>
/encoding/<charset>/<base64body>
You could generate some url safe encodings like this:
That script generates these URLs:
And the browser (or any client) should be able to render the same chars, with the exception of the unicode specific '🎉'.
The existing endpoint https://httpbin.dev/encoding/utf8 continues to work the same with this change at https://httpbin.jskw.dev/encoding/utf8 -- and I also have it re-encode the demo into utf16 and utf32. It's interesting that Firefox does a better job at rendering utf16 but both Chrome and Firefox don't do utf32 at all.
To be fair the utility of utf16 and utf32 doesn't really make sense in the browser, it would only really make sense on specialized clients that need to be able to seek through unicode data without variable length encoding of the larger codepoints.
I've found that Firefox does pretty well with both utf-8 and utf-16 but not utf-32. Chrome makes a bit of a mess of the utf-8 demo re-encoded to utf-8.