From c60d5e8efdd6208968250e397d9e2676d6e347fc Mon Sep 17 00:00:00 2001 From: Genevieve Alfirevic Date: Thu, 3 Mar 2022 23:04:48 -0600 Subject: Display strings in comments if they are utf8 --- gifprobe/src/main.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'gifprobe') diff --git a/gifprobe/src/main.rs b/gifprobe/src/main.rs index 128aae1..f73384d 100644 --- a/gifprobe/src/main.rs +++ b/gifprobe/src/main.rs @@ -66,7 +66,12 @@ fn main() { } Block::LoopingExtension(_) => todo!(), Block::CommentExtension(cmt) => { - println!("Comment Extension\n\tLength {}", cmt.len()) + println!("Comment Extension\n\tLength {}", cmt.len().yellow()); + + match String::from_utf8(cmt) { + Ok(cmt) => println!("\tString \"{}\"", cmt.yellow()), + Err(_) => println!("\tString {}", "Content is not utf8".red()), + } } Block::ApplicationExtension(app) => { let auth = app.authentication_code(); -- cgit 1.4.1-3-g733a5