mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-06 13:29:56 -05:00
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
This commit is contained in:
parent
4981092a79
commit
83591883d8
1 changed files with 18 additions and 4 deletions
|
|
@ -31,6 +31,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
|
#include <locale.h>
|
||||||
|
|
||||||
#include <sndfile.h>
|
#include <sndfile.h>
|
||||||
|
|
||||||
|
|
@ -236,6 +237,8 @@ int main(int argc, char *argv[]) {
|
||||||
{NULL, 0, NULL, 0}
|
{NULL, 0, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
setlocale(LC_ALL, "");
|
||||||
|
|
||||||
if (!(bn = strrchr(argv[0], '/')))
|
if (!(bn = strrchr(argv[0], '/')))
|
||||||
bn = argv[0];
|
bn = argv[0];
|
||||||
else
|
else
|
||||||
|
|
@ -348,12 +351,23 @@ int main(int argc, char *argv[]) {
|
||||||
goto quit;
|
goto quit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!client_name)
|
if (!client_name) {
|
||||||
client_name = pa_xstrdup(bn);
|
client_name = pa_locale_to_utf8(bn);
|
||||||
|
if (!client_name)
|
||||||
|
client_name = pa_utf8_filter(bn);
|
||||||
|
}
|
||||||
|
|
||||||
if (!stream_name) {
|
if (!stream_name) {
|
||||||
const char *n = sf_get_string(sndfile, SF_STR_TITLE);
|
const char *n;
|
||||||
stream_name = pa_xstrdup(n ? n : filename);
|
|
||||||
|
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) {
|
if (verbose) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue