From patchwork Mon Apr 11 17:48:41 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: wk X-Patchwork-Id: 6385 Return-path: Envelope-to: mchehab@pedra Delivery-date: Mon, 11 Apr 2011 14:49:09 -0300 Received: from mchehab by pedra with local (Exim 4.72) (envelope-from ) id 1Q9LEb-000402-9V for mchehab@pedra; Mon, 11 Apr 2011 14:49:09 -0300 Received: from casper.infradead.org [85.118.1.10] by pedra with IMAP (fetchmail-6.3.17) for (single-drop); Mon, 11 Apr 2011 14:49:09 -0300 (BRT) Received: from vger.kernel.org ([209.132.180.67]) by casper.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1Q9LEG-0002dO-U7; Mon, 11 Apr 2011 17:48:49 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754818Ab1DKRsr (ORCPT + 1 other); Mon, 11 Apr 2011 13:48:47 -0400 Received: from mailout-de.gmx.net ([213.165.64.22]:58244 "HELO mailout-de.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1754720Ab1DKRsq (ORCPT ); Mon, 11 Apr 2011 13:48:46 -0400 Received: (qmail 2865 invoked by uid 0); 11 Apr 2011 17:48:44 -0000 Received: from 212.185.232.63 by www025.gmx.net with HTTP; Mon, 11 Apr 2011 19:48:41 +0200 (CEST) Date: Mon, 11 Apr 2011 19:48:41 +0200 From: handygewinnspiel@gmx.de In-Reply-To: <4D9C5C4D.4040709@redhat.com> Message-ID: <20110411174841.268990@gmx.net> MIME-Version: 1.0 References: <4D9C5C4D.4040709@redhat.com> Subject: Re: dvb-apps: charset support To: Mauro Carvalho Chehab , linux-media@vger.kernel.org X-Authenticated: #4875094 X-Flags: 0001 X-Mailer: WWW-Mail 6100 (Global Message Exchange) X-Priority: 3 X-Provags-ID: V01U2FsdGVkX19DEX0U7IlDrdq2Z+byuZiIQxvMH0+l6CXqgtAHLY Z1FlDoS/xhSazd00Ocd4Jmyie0be8K+odeoA== X-GMX-UID: mFLIJVo8TlI8Qz4GPWhrSsJOU2poZZlZ Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Sender: Hi Mauro, > I added some patches to dvb-apps/util/scan.c in order to properly support > EN 300 468 charsets. > Before the patch, scan were producing invalid UTF-8 codes here, for > ISO-8859-15 charsets, as > scan were simply filling service/provider name with whatever non-control > characters that were > there. So, if your computer uses the same character as your service > provider, you're lucky. > Otherwise, invalid characters will appear at the scan tables. > > After the changes, scan gets the locale environment charset, and use it as > the output charset > on the output files. This implementation in scan expects the environment settings to be 'language_country.encoding', but i think the more general way is 'language_country.encoding@variant'. i get the following error from scan, because iconv doesnt know 'ISO-8859-15@euro'. WARNING: Conversion from ISO-8859-9 to ISO-8859-15@euro not supported WARNING: Conversion from ISO-8859-9 to ISO-8859-15@euro not supported ... WARNING: Conversion from ISO-8859-15 to ISO-8859-15@euro not supported WARNING: Conversion from ISO-8859-15 to ISO-8859-15@euro not supported I suggest to change scan.c as follows: This cuts the '@variant' part from charset, so that iconv will find its way. cheers, Winfried --- dvb-apps-5e68946b0e0d_orig/util/scan/scan.c 2011-04-10 20:22:52.000000000 +0200 +++ dvb-apps-5e68946b0e0d/util/scan/scan.c 2011-04-11 19:41:21.460000060 +0200 @@ -2570,14 +2570,14 @@ if ((charset = getenv("LC_ALL")) || (charset = getenv("LC_CTYPE")) || (charset = getenv ("LANG"))) { - while (*charset != '.' && *charset) - charset++; - if (*charset == '.') - charset++; - if (*charset) - output_charset = charset; - else - output_charset = nl_langinfo(CODESET); + // assuming 'language_country.encoding@variant' + char * p; + + if ((p = strchr(charset, '.'))) + charset = p + 1; + if ((p = strchr(charset, '@'))) + *p = 0; + output_charset = charset; } else output_charset = nl_langinfo(CODESET);