Skip to content
Playground(another site)

bynk.embed.binary_content

Error An embed names a file with a NUL byte, so it is binary, not text.

An embed becomes a String in the compiled code, so its file must be text. A file holding a NUL byte is binary, and a String made from it would be meaningless. Binary data belongs in assets/, where the platform serves it as a file. Text that is not valid UTF-8 is bynk.embed.invalid_encoding.

Example

embed logo = "embeds/logo.png" // ✗ the file has a NUL byte
asset logo = "assets/logo.png" // ✓ a binary file is served, not read

In the Book

See also

  • Every code in its category, Embedded text, on the diagnostic index.
  • bynk explain bynk.embed.binary_content shows the same from the installed toolchain, without a network.