diff options
author | Genevieve Alfirevic <gen@nyble.dev> | 2022-03-03 23:04:48 -0600 |
---|---|---|
committer | Genevieve Alfirevic <gen@nyble.dev> | 2022-03-03 23:04:48 -0600 |
commit | c60d5e8efdd6208968250e397d9e2676d6e347fc (patch) | |
tree | 3f7afa09c842b8c0298576b7786a7f8055c41e79 /gifprobe | |
parent | ddbde4e47eab2f7c5d6a8518eafaa97cd81bc46c (diff) | |
download | gifed-c60d5e8efdd6208968250e397d9e2676d6e347fc.tar.gz gifed-c60d5e8efdd6208968250e397d9e2676d6e347fc.zip |
Display strings in comments if they are utf8
Diffstat (limited to 'gifprobe')
-rw-r--r-- | gifprobe/src/main.rs | 7 |
1 files changed, 6 insertions, 1 deletions
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(); |