X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Message-ID: <4D49E13C.9020406@cwilson.fastmail.fm> Date: Wed, 02 Feb 2011 17:57:00 -0500 From: Charles Wilson Reply-To: Charles Wilson User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 MIME-Version: 1.0 To: cygwin AT cygwin DOT com, bug-gnulib Subject: Re: Bug in libiconv? References: <201102021958 DOT 13196 DOT bruno AT clisp DOT org> <20110202211957 DOT GM2675 AT calimero DOT vinschen DOT de> In-Reply-To: <20110202211957.GM2675@calimero.vinschen.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com On 2/2/2011 4:19 PM, Corinna Vinschen wrote: > On Feb 2 19:58, Bruno Haible wrote: >> charset.alias is requested on Linux, even though it normally does not exist, >> so that packagers and users have a chance to modify the behaviour. > > I beg to keep this choice to Cygwin users as well. It will be empty by > default as well. The supported codesets are documented in > http://cygwin.com/cygwin-ug-net/setup-locale.html#setup-locale-charsetlist > If some weird alias is required, the user can add it to charset.alias. > That's the optimal solution. FWIW, using a fresh git clone of libiconv 3cdff14a3cc549dc4ccfe02dca46e73b1e7a68c6 Sat Jan 29 18:34:14 2011 +0100) bootstrapped using a fresh gnulib a036b7684f9671ee53999773785d1865603c3849 Tue Feb 1 10:04:17 2011 -0800 and no other patches, libiconv + cygwin-1.7.7 [note: NOT 1.7.8pre] works, passes its own self-tests, and passes Corinna's original test case that spawned this thread. Bruno's change in libiconv was: - This is also the case on native Woe32 systems. */ -#if __STDC_ISO_10646__ || ((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__) + This is also the case on native Woe32 systems and Cygwin >= 1.7, where + we know that it is UTF-16. */ +#if ((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__) || (defined __CYGWIN__ && CYGWIN_VERSION_DLL_MAJOR >= 1007) ...some code... +#elif __STDC_ISO_10646__ ...other code... #endif repeated at various places. Obviously the use of CYGWIN_VERSION_DLL_MAJOR means there is a +#ifdef __CYGWIN__ +#include +#endif in there, too. Now, this configuration does NOT include: 1) Corinna's suggested change to localcharset.c that modified get_charset_alias() to use charset.alias on cygwin instead of hardcoding the alias list, NOR the change in that file to locale_charset() to deal with copying the value returned by nl_langinfo() and remove some special cygwin workarounds involving GetACP(). 2) the relocation changes to avoid deprecated path conversion functions and to do things on cygwin "the linux way". http://lists.gnu.org/archive/html/bug-gnulib/2011-01/msg00522.html I tested both with and without --enable-relocatable... >> But such a user will then write a mail to a mailing list, and it will take >> time for me (or someone else) to investigate and answer it. By writing >> #if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ >> I avoid this potential problem. > > Ok. However, the other variation > > #if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ > > should be only used in very rare circumstances. Usually it just means > that some unnecessary Windowism is used on Cygwin, and that there's > probably a POSIXy equivalent. If not, kick us here on the list and > we can discuss it. See above, with the #if ((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__) || (defined __CYGWIN__ && CYGWIN_VERSION_DLL_MAJOR >= 1007) formulation. It's not an erroneous use of a windowism, it just reflects that cygwin's unicode impl shares characteristics with the underlying win32 unicode support. -- Chuck -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple