videoplayer: work around SDL window title bug
authorKostya Shishkov <kostya.shishkov@gmail.com>
Tue, 1 Aug 2023 16:41:32 +0000 (18:41 +0200)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Wed, 2 Aug 2023 07:20:39 +0000 (09:20 +0200)
videoplayer/src/main.rs

index 98d3447c73244b16a24f38821386fdf437dd81c5..89deb7c910e748d6542ed7470fd3374e9ed5e4c3 100644 (file)
@@ -722,7 +722,10 @@ impl Player {
 
         let fname = path.file_name();
         let wname = if let Some(fname) = fname {
-                "NihAV player - ".to_owned() + fname.to_str().expect("should be able to set window title")
+                // workaround for libSDL2 workaround for non-UTF8 windowing systems
+                // see https://github.com/libsdl-org/SDL/pull/4290 for detais
+                let nname = fname.to_str().expect("should be able to set window title").replace('\u{2013}', "-");
+                "NihAV player - ".to_owned() + &nname
             } else {
                 "NihAV player".to_owned()
             };