[MPlayer-dev-eng] [PATCH] charset conversion for help messages

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Sat Feb 19 12:40:20 CET 2005


Hi,
the attached patch adds a --charset option to the configure options that
will make MPlayer convert the help_mp-* file to the specified charset -
it needs the right from charset to be specified in a
help_mp-??.h.charset file.
What do you think of this? It is a really small patch, and I think this
is quite useful, especially as I think we really should support utf8 -
it seems the only useable charset to me.

Greetings,
Reimar Döffinger
-------------- next part --------------
Index: configure
===================================================================
RCS file: /cvsroot/mplayer/main/configure,v
retrieving revision 1.964
diff -u -r1.964 configure
--- configure	18 Feb 2005 03:55:27 -0000	1.964
+++ configure	19 Feb 2005 11:35:18 -0000
@@ -285,6 +286,7 @@
   --target=PLATFORM      target platform (i386-linux, arm-linux, etc)
   --enable-static        build a statically linked binary. Set further linking
                          options with --enable-static="-lslang -lncurses"
+  --charset              convert the help messages to this charset
   --language=list        a white space or comma separated list of languages
                          for translated man pages, the first language is the
                          primary and therefore used for translated messages
@@ -1383,6 +1385,7 @@
 #_language=en
 _shm=auto
 _linux_devfs=no
+#_charset=utf8
 _i18n=auto
 _dynamic_plugins=no
 _crash_debug=auto
@@ -1682,6 +1688,9 @@
   --enable-sortsub) _sortsub=yes ;;
   --disable-sortsub) _sortsub=no ;;
 
+  --charset=*)
+    _charset=`echo $ac_option | cut -d '=' -f 2`
+    ;;
   --language=*)
     _language=`echo $ac_option | cut -d '=' -f 2`
     ;;
@@ -6649,6 +6677,7 @@
 EXTRA_INC = $_inc_extra $_inc_gtk
 OPTFLAGS = -I../libvo -I../../libvo $_inc_x11 $CFLAGS \$(EXTRA_INC)
 STRIPBINARIES = $_stripbinaries
+CHARSET = $_charset
 HELP_FILE = $_mp_help
 
 PRG = $_prg
Index: Makefile
===================================================================
RCS file: /cvsroot/mplayer/main/Makefile,v
retrieving revision 1.314
diff -u -r1.314 Makefile
--- Makefile	31 Dec 2004 11:11:24 -0000	1.314
+++ Makefile	19 Feb 2005 11:35:19 -0000
@@ -399,7 +399,11 @@
 help_mp.h: help/help_mp-en.h $(HELP_FILE)
 	@echo '// WARNING! This is a generated file. Do NOT edit.' > help_mp.h
 	@echo '// See the help/ subdir for the editable files.' >> help_mp.h
+ifeq ($(CHARSET),)
 	@echo '#include "$(HELP_FILE)"' >> help_mp.h
+else
+	iconv -f `cat $(HELP_FILE).charset` -t $(CHARSET) "$(HELP_FILE)" >> help_mp.h
+endif
 
 ifneq ($(HELP_FILE),help/help_mp-en.h)
 	@echo "Adding untranslated messages to help_mp.h"


More information about the MPlayer-dev-eng mailing list