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

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -