Repository navigation
Conversation
…se64
A body crossed into Luau as String::from_utf8_lossy, so every byte that
isn't UTF-8 became U+FFFD: a fetched TTF or PNG came back corrupted, and a
plugin had no way to download one. With { binary = true } the body is the
bytes in base64 (Luau gets results as JSON, which carries text only). The
default stays text.
This was referenced Nov 12, 2026
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
zeron.fetchhands the body to Luau asString::from_utf8_lossy, so a font or a picture comes back with every non-UTF-8 byte turned into U+FFFD. A plugin can't download a Google Font or an image through its service.Now
zeron.fetch(url, { binary = true })returnsbodyas the bytes in base64. Results reach Luau as JSON, which carries only text, so base64 is the safe way across. The 16 MB cap and the default text body don't change.Related: #1367 takes the result as
zeron.load_font { base64 = r.body }, and zeronsh/zgx#2074 adds the same for a window'sui.load_font.Testing
fetch_gives_bytes_in_base64_when_asked: a local server sends all 256 byte values plus NUL and 0x80. Withbinarythe decoded body matches byte for byte. Without it, the body is the lossy text, as before.cargo test -p zeron-engine --lib plugins::service::tests::fetchpasses on Windows, withgetrusagein two test helpers stubbed locally (not in this PR).Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.