Skip to content

Commit

Permalink
fix: Encoding not passed through in query options
Browse files Browse the repository at this point in the history
  • Loading branch information
p-avital committed Dec 4, 2023
1 parent cd4d083 commit 0920557
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/get.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,14 @@ impl From<&z_value_t> for Value {
unsafe {
let value: Value =
std::slice::from_raw_parts(val.payload.start, val.payload.len).into();
value
let encoding = std::str::from_utf8(std::slice::from_raw_parts(
val.encoding.suffix.start,
val.encoding.suffix.len,
))
.expect("encodings must be UTF8");
value.encoding(
zenoh::prelude::Encoding::new(val.encoding.prefix as u8, encoding).unwrap(),
)
}
}
}
Expand Down

0 comments on commit 0920557

Please sign in to comment.