[polypaudio-commits] r932 - /trunk/src/utils/paplay.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Thu May 18 01:21:42 PDT 2006


Author: ossman
Date: Thu May 18 10:21:41 2006
New Revision: 932

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=932&root=polypaudio&view=rev
Log:
Make paplay convert names to UTF-8 before sending to the server.

Modified:
    trunk/src/utils/paplay.c

Modified: trunk/src/utils/paplay.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/utils/paplay.c?rev=932&root=polypaudio&r1=931&r2=932&view=diff
==============================================================================
--- trunk/src/utils/paplay.c (original)
+++ trunk/src/utils/paplay.c Thu May 18 10:21:41 2006
@@ -31,6 +31,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <getopt.h>
+#include <locale.h>
 
 #include <sndfile.h>
 
@@ -236,6 +237,8 @@
         {NULL,          0, NULL, 0}
     };
 
+    setlocale(LC_ALL, "");
+
     if (!(bn = strrchr(argv[0], '/')))
         bn = argv[0];
     else
@@ -348,12 +351,23 @@
         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) {




More information about the pulseaudio-commits mailing list