From patchwork Thu Jun 28 19:34:10 2007 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Udo Richter X-Patchwork-Id: 12482 Received: from mail.gmx.net ([213.165.64.20]) by www.linuxtv.org with smtp (Exim 4.63) (envelope-from ) id 1I3zmV-0003Hx-Kw for vdr@linuxtv.org; Thu, 28 Jun 2007 21:35:55 +0200 Received: (qmail invoked by alias); 28 Jun 2007 19:35:25 -0000 Received: from Qa74e.q.pppool.de (EHLO localhost) [89.53.167.78] by mail.gmx.net (mp057) with SMTP; 28 Jun 2007 21:35:25 +0200 X-Authenticated: #1417946 X-Provags-ID: V01U2FsdGVkX19S8kxgQH1SktMVwJRGi/N2eNuUE7Qaq9QkubhkP6 6gHYA1GQcVU20A Message-ID: <46840D32.4020604@gmx.de> Date: Thu, 28 Jun 2007 21:34:10 +0200 From: Udo Richter User-Agent: Thunderbird 2.0.0.4 (Windows/20070604) MIME-Version: 1.0 To: VDR Mailing List X-Y-GMX-Trusted: 0 Subject: [vdr] =?iso-8859-1?q?=5Bvdr-1=2E5=2E5=5D=5BPatch=5D_inc/dec_chara?= =?iso-8859-1?q?cter_not_working_for_=C4=D6=DC_in_non-UTF8?= 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: Thu, 28 Jun 2007 19:35:55 -0000 Status: O X-Status: X-Keywords: X-UID: 13373 Hi Klaus, Found a bug in VDR-1.5.5 in non-UTF8 mode. In any text field, when the cursor is on an uppercase non-ASCII character like ÄÖÜ, the up/down key jumps directly to A. The core problem is that the non-UTF8 version of Utf8ToArray sign-extends chars to uints, turning the ä of the allowed chars into 0xFFFFFFE4, while the towlower() of the edit control changes the Ä into 0x000000E4, which is then not in the list of allowed characters. Lowercase works, since here everything stays sign-extended. The attached patch changes Utf8ToArray to properly extend chars as unsigned. Cheers, Udo --- vdr-1.5.5-orig/tools.c 2007-06-23 15:38:30.000000000 +0200 +++ vdr-1.5.5/tools.c 2007-06-28 21:10:58.000000000 +0200 @@ -685,7 +685,7 @@ int n = 0; while (*s && --Size > 0) { if (cCharSetConv::SystemCharacterTable()) - *a++ = *s++; + *a++ = (unsigned char)(*s++); else { int sl = Utf8CharLen(s); *a++ = Utf8CharGet(s, sl);