Skip to content

fix(vfs): preserve raw bytes when reading /dev/urandom#828

Merged
chaliy merged 1 commit intomainfrom
fix/issue-811-urandom-raw-bytes
Mar 26, 2026
Merged

fix(vfs): preserve raw bytes when reading /dev/urandom#828
chaliy merged 1 commit intomainfrom
fix/issue-811-urandom-raw-bytes

Conversation

@chaliy
Copy link
Copy Markdown
Contributor

@chaliy chaliy commented Mar 26, 2026

Summary

  • Replace String::from_utf8_lossy with Latin-1 byte-to-char mapping for file reads
  • Bytes > 0x7F are now preserved instead of being replaced with U+FFFD
  • Applied to interpreter file reads and head builtin byte mode

Test plan

  • urandom_no_replacement_chars — verifies no U+FFFD in od output
  • Full test suite passes

Closes #811

Closes #811 — /dev/urandom now returns raw bytes instead of UTF-8
replacement characters. Changed file content conversion from
String::from_utf8_lossy (which replaces bytes > 0x7F with U+FFFD) to
Latin-1 mapping (each byte 0x00-0xFF maps to its Unicode code point).
@chaliy chaliy merged commit e2c3181 into main Mar 26, 2026
18 of 23 checks passed
@chaliy chaliy deleted the fix/issue-811-urandom-raw-bytes branch March 26, 2026 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: /dev/urandom returns UTF-8 replacement chars instead of raw bytes

1 participant