From patchwork Mon Jun 11 06:39:49 2007 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Klaus Schmidinger X-Patchwork-Id: 12473 Received: from raven.cadsoft.de ([217.7.101.211]) by www.linuxtv.org with esmtp (Exim 4.63) (envelope-from ) id 1HxdZ8-0005UG-Rr for vdr@linuxtv.org; Mon, 11 Jun 2007 08:39:50 +0200 Received: from [192.168.100.10] (hawk.cadsoft.de [192.168.100.10]) by raven.cadsoft.de (8.13.3/8.13.3) with ESMTP id l5B6dnWn026798 for ; Mon, 11 Jun 2007 08:39:49 +0200 Message-ID: <466CEE35.4070403@cadsoft.de> Date: Mon, 11 Jun 2007 08:39:49 +0200 From: Klaus Schmidinger Organization: CadSoft Computer GmbH User-Agent: Thunderbird 1.5.0.12 (X11/20060911) MIME-Version: 1.0 To: vdr@linuxtv.org References: <466C0096.60200@cadsoft.de> <1181485931.5684.4.camel@lorien.roitburd.de> In-Reply-To: <1181485931.5684.4.camel@lorien.roitburd.de> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (raven.cadsoft.de [192.168.1.1]); Mon, 11 Jun 2007 08:39:50 +0200 (CEST) Subject: Re: [vdr] [ANNOUNCE] VDR developer version 1.5.3 X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.9 Precedence: list Reply-To: VDR Mailing List List-Id: VDR Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2007 06:39:51 -0000 Status: O X-Status: X-Keywords: X-UID: 13168 On 06/10/07 16:32, Oleg Roitburd wrote: > Hi, > On Sun, 2007-06-10 at 15:45 +0200, Klaus Schmidinger wrote: >> VDR developer version 1.5.3 is now available at >> >> ftp://ftp.cadsoft.de/vdr/Developer/vdr-1.5.3.tar.bz2 >> >> A 'diff' against the previous developer version is available at >> >> ftp://ftp.cadsoft.de/vdr/Developer/vdr-1.5.2-1.5.3.diff > >> - The pixel fonts have been completely removed from the VDR source. >> - VDR is now "UTF-8 aware". It handles strings according to the character >> encoding used on the user's system. All internationalization strings and >> incoming SI data are converted to the system encoding. > > nice to hear this. > I'm beginning with 1st plugin, that can't this handle. and it's your > plugin :-) > make[1]: Entering directory `/tmp/vdr-1.5.3/PLUGINS/src/skincurses' > ... The attached patch makes it compile. I haven't been able to see it display UTF-8 characters, though. >From what I've seen on the web it should work when linked with -lncursesw, but then again maybe just setting LANG=de_DE.utf8 isn't enough to tell curses to actually use UTF-8 on an otherwise pure ISO system... Klaus --- PLUGINS/src/skincurses/Makefile 2006/09/09 12:38:35 1.7 +++ PLUGINS/src/skincurses/Makefile 2007/06/10 16:19:08 @@ -66,7 +66,7 @@ all: libvdr-$(PLUGIN).so libvdr-$(PLUGIN).so: $(OBJS) - $(CXX) $(CXXFLAGS) -shared $(OBJS) -lncurses -o $@ + $(CXX) $(CXXFLAGS) -shared $(OBJS) -lncursesw -o $@ @cp --remove-destination $@ $(LIBDIR)/$@.$(APIVERSION) dist: clean --- PLUGINS/src/skincurses/skincurses.c 2006/09/10 14:23:55 1.11 +++ PLUGINS/src/skincurses/skincurses.c 2007/06/10 16:18:17 @@ -6,6 +6,8 @@ * $Id: skincurses.c 1.11 2006/09/10 14:23:55 kls Exp kls $ */ +//XXX TODO strlen()! + #include #include #include @@ -19,12 +21,10 @@ class cCursesFont : public cFont { public: - cCursesFont(void): cFont(NULL) {} - virtual int Width(unsigned char c) const { return 1; } + virtual int Width(uint c) const { return 1; } virtual int Width(const char *s) const { return s ? strlen(s) : 0; } - virtual int Height(unsigned char c) const { return 1; } - virtual int Height(const char *s) const { return 1; } virtual int Height(void) const { return 1; } + virtual void DrawText(cBitmap *Bitmap, int x, int y, const char *s, tColor ColorFg, tColor ColorBg, int Width) const {} }; static const cCursesFont Font; @@ -135,6 +135,8 @@ void cCursesOsd::DrawText(int x, int y, const char *s, tColor ColorFg, tColor ColorBg, const cFont *Font, int Width, int Height, int Alignment) { + if (!s) + return; int w = Font->Width(s); int h = Font->Height(); if (Width || Height) {