Unicode output does not roundtrip
Open
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 391
- Forks
- 69
- Avg merge
- 1d 34m
- Merged PRs (30d)
- 2
Description
When I put the unicode character "∀" into cat, the output doesn't roundtrip:
Input:
∀
226 136 128
Output:
195 162 194 136 194 128
Code:
use rexpect::spawn;
use rexpect::error::*;
fn display(s: &str)
{
println!("{}", s);
for b in s.as_bytes()
{
print!("{} ", b);
}
println!("");
}
fn repl() -> Result<(), Error>
{
let mut p = spawn("cat", Some(1000))?;
let ex: String = "∀".to_string();
p.send_line(&ex)?;
let line = p.read_line()?;
println!("Input:");
display(&ex);
println!("Output:");
display(&line);
Ok(())
}
fn main()
{
repl().unwrap_or_else(|e| panic!("ftp job failed with {}", e));
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Run the Rust reproduction shown with cat and trace the spawn, send_line, and read_line entry points. Verify where the Unicode bytes change during the round trip; done means sending ∀ through cat returns the same character and UTF-8 bytes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli, operating-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100