postmodern on Nostr: So here's a weird problem. Say I want to embed literal binary data into an HTML page, ...
So here's a weird problem. Say I want to embed literal binary data into an HTML page, so it could be copy/pasted raw (don't ask). However, this often causes "invalid byte-sequence in UTF-8" when Rack::Utils.escape_html() tries to escape any HTML control characters. How do I get around this?
#rack #ruby
Published at
2024-07-02 20:12:26Event JSON
{
"id": "0da6c3f88271bc0e2bf825ca0ad5eddd1e06f79aa774c84cf51780cde4d94b87",
"pubkey": "ae2c5f0d5767d4845b235502cf6bd6fc541334009c28221ab3d3cb9d9895f437",
"created_at": 1719951146,
"kind": 1,
"tags": [
[
"t",
"rack"
],
[
"t",
"ruby"
],
[
"proxy",
"https://ruby.social/users/postmodern/statuses/112718718311527807",
"activitypub"
]
],
"content": "So here's a weird problem. Say I want to embed literal binary data into an HTML page, so it could be copy/pasted raw (don't ask). However, this often causes \"invalid byte-sequence in UTF-8\" when Rack::Utils.escape_html() tries to escape any HTML control characters. How do I get around this?\n#rack #ruby",
"sig": "7d18e49f93c963b4f3f2d764667e101d5453ff4f1ff35eefae99f433352aec0bf154b060b7fe4fc9b91aae26c455b740037527ce5004ba1c463f3c3ae2a0c8e5"
}