]> git.nihav.org Git - nihav-player.git/commitdiff
videoplayer: improve window title sanitisation
authorKostya Shishkov <kostya.shishkov@gmail.com>
Thu, 9 Oct 2025 16:14:11 +0000 (18:14 +0200)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Thu, 9 Oct 2025 16:22:45 +0000 (18:22 +0200)
videoplayer/src/main.rs

index ca407d9b69c5a1f7c250c3ed79cd2859e5465cb0..7008460a1d702b1894a5aadf48e94ad071bba6fc 100644 (file)
@@ -878,7 +878,8 @@ impl Player {
         let wname = if let Some(fname) = fname {
                 // 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}', "-").replace('\u{2014}', "-");
+                let nname = fname.to_str().expect("should be able to set window title").replace(['\u{2013}', '\u{2014}', '\u{2022}'], "-")
+                        .replace('\u{490}', "\u{413}").replace('\u{491}', "\u{433}");
                 "NihAV player - ".to_owned() + &nname
             } else {
                 "NihAV player".to_owned()