rust - How to write Cyrillic text when using the debugging format? -
while using println!
works expected:
println!("Привет!"); // Привет!
with debugging format however:
println!("{:?}", "Привет!"); // "\u{41f}\u{440}\u{438}\u{432}\u{435}\u{442}!"
using assert!
:
assert!("Привет!" != "Привет!") // 'assertion failed: "\u{41f}\u{440}\u{438}\u{432}\u{435}\u{442}!" != "\u{41f}\u{440}\u{438}\u{432}\u{435}\u{442}!"
is there way have assert!
print correctly in debug format?
so far rust concerned, is correct. implementation of debug
str
restricts printable ascii characters output readable irrespective of codepage or output mechanism.
i don't believe there's can change strings in general; on case-by-case basis, can use display
instead, or create wrapper around &str
forwards display
instead of debug
.
Comments
Post a Comment