pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/43163: mpc has encoding problem on non-Linux systems



>Number:         43163
>Category:       pkg
>Synopsis:       mpc has encoding problem on non-Linux systems
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 14 19:10:00 +0000 2010
>Originator:     Oleg Pilyavets
>Release:        NetBSD 5.0.2
>Organization:
unicam
>Environment:
NetBSD user 5.0.2 NetBSD 5.0.2 (MYKERNEL) #0: вс 
апр 11 17:39:14 UTC 2010  
spinore@user:/usr/src/sys/arch/i386/compile/MYKERNEL i386
>Description:
Developer of mpc (client for music player daemon) uses non-standard glibc 
extension to iconv, namely, //IGNORE. Therefore, no recoding to system locale 
happens on netbsd. At the same time, it works fine on Linux. The problem arises 
in versions of mpc>12.0.

The second problem is that, if stdout is not TTY, mpc does not make encoding 
conversion.

I failed to register in their http://musicpd.org/mantis/ bugtracker, so have to 
write this here.

>How-To-Repeat:
Commands
$ mpc ls
or
$ mpc playlist
show buggy encoding for Russian characters. My locale is:
$ locale
LANG="ru_RU.KOI8-R"
LC_CTYPE="ru_RU.KOI8-R"
LC_COLLATE="C"
LC_TIME="C"
LC_NUMERIC="C"
LC_MONETARY="C"
LC_MESSAGES="ru_RU.KOI8-R"
LC_ALL=""

At the same time, e.g., ncmpc client works fine.

Pipe problem can be reproduced by comparing commands
$ mpc
and
$ mpc | cat
whose outputs do not coincide.
>Fix:
Good fix should extensively change source code, but I used the following 
workaround. I switched off IGNORE in source code using these patches (for 
version 0.16):
$ diff -u OLD/mpc-0.16/src/main.c NEW/mpc-0.16/src/main.c
--- mpc-0.16/src/main.c 2009-05-25 15:39:01.000000000 +0200
+++ /home/spinore/mpcdir/mpc-0.16/src/main.c    2010-04-14 19:54:32.000000000 
+0200
@@ -280,8 +280,9 @@

        /* initialization */

-       charset_init(command->pipe >= 0 || isatty(STDIN_FILENO),
-                    isatty(STDOUT_FILENO));
+       /* charset_init(command->pipe >= 0 || isatty(STDIN_FILENO),
+                    isatty(STDOUT_FILENO)); */
+       charset_init(1, 1);

        /* run */


$ diff -u OLD/mpc-0.16/src/charset.c NEW/mpc-0.16/src/charset.c 
--- mpc-0.16/src/charset.c      2009-05-25 15:38:59.000000000 +0200
+++ /home/spinore/mpcdir/mpc-0.16/src/charset.c 2010-04-14 19:46:40.000000000 
+0200
@@ -189,7 +189,8 @@
        if (!enable_input && !enable_output)
                return;
 
-       ignore_invalid = isatty(STDOUT_FILENO) && isatty(STDIN_FILENO);
+       /* ignore_invalid = isatty(STDOUT_FILENO) && isatty(STDIN_FILENO); */
+       ignore_invalid = 0; 
 
        original_locale = setlocale(LC_CTYPE,"");
        if (original_locale == NULL)

However, if musicpd base cannot be reencoded in system locale, new problems 
will appear due to the patch.



Home | Main Index | Thread Index | Old Index