There is no common character encoding for ID3 tags, anything that is not
compatible with UTF-8 or ASCII results in an error message with ncmpc.
This diff fixes the ugly "Unable to convert.." message by using a glib
funktion that replaces broken chars with '?'.

Index: Makefile
===================================================================
RCS file: /cvs/ports/audio/ncmpc/Makefile,v
retrieving revision 1.4
diff -u -r1.4 Makefile
--- Makefile    16 Dec 2006 12:22:32 -0000      1.4
+++ Makefile    2 Jan 2007 01:01:21 -0000
@@ -6,6 +6,7 @@
 COMMENT=               "curses based frontend for mpd"
 
 DISTNAME=              ncmpc-0.11.1
+PKGNAME=               ${DISTNAME}p0
 CATEGORIES=            audio
 
 HOMEPAGE=              http://hem.bredband.net/kaw/ncmpc/
Index: patches/patch-src_support_c
===================================================================
RCS file: patches/patch-src_support_c
diff -N patches/patch-src_support_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_support_c 2 Jan 2007 01:01:21 -0000
@@ -0,0 +1,15 @@
+--- src/support.c.orig Sun Jan 23 18:37:41 2005
++++ src/support.c      Tue Jan  2 01:53:34 2007
+@@ -156,10 +156,8 @@
+   rb = 0; /* bytes read */
+   wb = 0; /* bytes written */
+   error = NULL;
+-  str=g_locale_from_utf8(utf8str, 
+-                       strlen(utf8str),
+-                       &wb, &rb,
+-                       &error);
++  str = g_convert_with_fallback(
++      utf8str, -1, "ASCII", "UTF-8", "?", &rb, &wb, &error);
+   if( error )
+     {
+       const char *charset;


-- 
Gnu's Not Useful

Reply via email to