summaryrefslogtreecommitdiffstats
path: root/src/utils/paplay.c
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2006-05-18 08:21:41 +0000
committerPierre Ossman <ossman@cendio.se>2006-05-18 08:21:41 +0000
commit83591883d8bcec475e74881b3f9cbcb84900c7ec (patch)
tree94fbda4a07821dc96400fccbd0508edf10ffc139 /src/utils/paplay.c
parent4981092a797c18c1be8f2d5e0864c8b30f4130a0 (diff)
Make paplay convert names to UTF-8 before sending to the server.
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@932 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src/utils/paplay.c')
-rw-r--r--src/utils/paplay.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/utils/paplay.c b/src/utils/paplay.c
index b66c13da..effc2a11 100644
--- a/src/utils/paplay.c
+++ b/src/utils/paplay.c
@@ -31,6 +31,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <getopt.h>
+#include <locale.h>
#include <sndfile.h>
@@ -236,6 +237,8 @@ int main(int argc, char *argv[]) {
{NULL, 0, NULL, 0}
};
+ setlocale(LC_ALL, "");
+
if (!(bn = strrchr(argv[0], '/')))
bn = argv[0];
else
@@ -348,12 +351,23 @@ int main(int argc, char *argv[]) {
goto quit;
}
- if (!client_name)
- client_name = pa_xstrdup(bn);
+ if (!client_name) {
+ client_name = pa_locale_to_utf8(bn);
+ if (!client_name)
+ client_name = pa_utf8_filter(bn);
+ }
if (!stream_name) {
- const char *n = sf_get_string(sndfile, SF_STR_TITLE);
- stream_name = pa_xstrdup(n ? n : filename);
+ const char *n;
+
+ n = sf_get_string(sndfile, SF_STR_TITLE);
+
+ if (!n)
+ n = filename;
+
+ stream_name = pa_locale_to_utf8(n);
+ if (!stream_name)
+ stream_name = pa_utf8_filter(n);
}
if (verbose) {