feat: add initial ignore unsafe utf8

This commit is contained in:
2025-12-16 10:54:31 +01:00
commit 62b0dee148
4 changed files with 44 additions and 0 deletions

20
src/main.rs Normal file
View File

@@ -0,0 +1,20 @@
use std::io::{Read, Write};
use anyhow::Context;
fn main() -> anyhow::Result<()> {
let mut input = std::io::stdin().lock();
let mut output = std::io::stdout().lock();
let mut output_bytes = Vec::new();
input
.read_to_end(&mut output_bytes)
.context("could not read stdin")?;
let safe_utf8_content = String::from_utf8_lossy(&output_bytes);
output.write_all(safe_utf8_content.as_bytes())?;
output.flush()?;
Ok(())
}