From 403f27c5310b327fef6dbbbf26b423ebf33fedcc Mon Sep 17 00:00:00 2001 From: Arseny Maslennikov Date: Thu, 25 Mar 2021 11:39:29 +0300 Subject: [PATCH] meson, pw-top: use ncursesw Some PulseAudio clients are known to use localised client and stream names as values for the respective PulseAudio props, most notably plain old pavucontrol. We call setlocale before anything else for ncurses to display localised text correctly. We also want to link with ncursesw, which supports multibyte Unicode locales. --- meson.build | 2 +- src/tools/pw-top.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 97d4d9392..939f97ce6 100644 --- a/meson.build +++ b/meson.build @@ -308,7 +308,7 @@ dl_lib = cc.find_library('dl', required : false) pthread_lib = dependency('threads') dbus_dep = dependency('dbus-1') sdl_dep = dependency('sdl2', required : get_option('sdl2')) -ncurses_dep = dependency('ncurses', required : false) +ncurses_dep = dependency('ncursesw', required : false) sndfile_dep = dependency('sndfile', version : '>= 1.0.20', required : get_option('sndfile')) gst_option = get_option('gstreamer') diff --git a/src/tools/pw-top.c b/src/tools/pw-top.c index 486d4e8dc..9657d341b 100644 --- a/src/tools/pw-top.c +++ b/src/tools/pw-top.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -495,6 +496,7 @@ int main(int argc, char *argv[]) struct timespec value, interval; struct node *n; + setlocale(LC_ALL, ""); pw_init(&argc, &argv); spa_list_init(&data.node_list);