about summary refs log tree commit diff
path: root/gifprobe/src/main.rs
diff options
context:
space:
mode:
authorGenevieve Alfirevic <gen@nyble.dev>2022-03-03 23:04:48 -0600
committerGenevieve Alfirevic <gen@nyble.dev>2022-03-03 23:04:48 -0600
commitc60d5e8efdd6208968250e397d9e2676d6e347fc (patch)
tree3f7afa09c842b8c0298576b7786a7f8055c41e79 /gifprobe/src/main.rs
parentddbde4e47eab2f7c5d6a8518eafaa97cd81bc46c (diff)
downloadgifed-c60d5e8efdd6208968250e397d9e2676d6e347fc.tar.gz
gifed-c60d5e8efdd6208968250e397d9e2676d6e347fc.zip
Display strings in comments if they are utf8
Diffstat (limited to 'gifprobe/src/main.rs')
-rw-r--r--gifprobe/src/main.rs7
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();