-
Notifications
You must be signed in to change notification settings - Fork 13.4k
serialize::json::Encoder emit_char serializes extra nulls #19719
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
fn escape_char(writer: &mut io::Writer, v: char) -> Result<(), io::IoError> {
let mut buf = [0, .. 4];
v.encode_utf8(&mut buf);
escape_bytes(writer, &mut buf)
} Ugh, this should be: fn escape_char(writer: &mut io::Writer, v: char) -> Result<(), io::IoError> {
let mut buf = [0, .. 4];
let sz = v.encode_utf8(&mut buf).unwrap();
escape_bytes(writer, buf[mut ..sz])
} |
lifthrasiir
added a commit
to lifthrasiir/rust
that referenced
this issue
Dec 12, 2014
I didn't see that @lifthrasiir had prepared a pull request, so I made a patch of my own. Oh well, it was a nice learning experience, and it helps prepare me to work on some of the stranger issues with @lifthrasiir's patch looks good. |
brson
added a commit
to brson/rust
that referenced
this issue
Dec 16, 2014
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Dec 17, 2014
lnicola
pushed a commit
to lnicola/rust
that referenced
this issue
May 5, 2025
chore: Adjust panic context printing
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following code snippet:
Produces the following output:
The serialized string should be
[34, 99, 34]
, and not[34, 99, 0, 0, 0, 34]
.The text was updated successfully, but these errors were encountered: