X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Message-ID: <4D437C30.4020407@cwilson.fastmail.fm> Date: Fri, 28 Jan 2011 21:32:16 -0500 From: Charles Wilson User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666 MIME-Version: 1.0 To: cygwin AT cygwin DOT com, bug-gnu-libiconv AT gnu DOT org Subject: Re: Bug in libiconv? References: <201101282312 DOT 50298 DOT bruno AT clisp DOT org> In-Reply-To: <201101282312.50298.bruno@clisp.org> Content-Type: multipart/mixed; boundary="------------050209000709030203040705" 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 --------------050209000709030203040705 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 1/28/2011 5:12 PM, Bruno Haible wrote: > Please CC the bug-gnu-libiconv mailing list when discussing possible > bugs in GNU libiconv. I hadn't intended on involving bug-gnu-libiconv until we had a working fix, and a consensus here on @cygwin. But, in any case, here is the portion of Corinna's patch dealing with the iconv issues, stripped down to the minimum necessary to correct the "problem". As pointed out in the @cygwin thread, there are still some open questions, which I had hoped to avoid by waiting until cygwin-1.7.8 was released. 1) On cygwin-1.7.8, __STDC_ISO_10646__ is defined, so this change will allow "correct" behavior *if compiled on cygwin-1.7.8*. -#if __STDC_ISO_10646__ || ((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__) +#if __STDC_ISO_10646__ || defined _WIN32 || defined __WIN32__ But cygwin-1.7.8 isn't out yet. But with this change (and the "don't include windows.h" change) then libiconv will still compile properly on cygwin-1.5 -- which does not support wide chars, and does NOT define __STDC_ISO_10646__. However, it WON'T compile properly on cygwin-1.7.x up to 1.7.7. 2) From cygwin-1.7.2 to cygwin-1.7.7, the following change could be used instead (there's an issue with 1.7.1 which doesn't bear exploration here): -#if __STDC_ISO_10646__ || ((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__) +#if __STDC_ISO_10646__ || defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ But arguably, then it would break on "old" cygwin like 1.5. Perhaps this is ok, since 1.7 has been "out" for over a year, and maybe bug-gnu-libiconv doesn't care about old, unsupported-by-the-cygwin-project versions of cygwin. In any case, the attached patch goes with option 1 above. It is completely orthogonal to, and independent of, the other "relocation" patch, that I posted to the gnulib list. 2010-01-28 Corinna Vinschen <...> Correct wchar handling on cygwin-1.7.x * lib/iconv.c (iconv_canonicalize): Allow __STDC_ISO_10646__ to control, rather than using __CYGWIN__ to veto. * lib/iconv_open1.h: Ditto. * libcharset/lib/localcharset.c: Don't include windows.h if __CYGWIN__. (get_charset_aliases): Remove cygwin workaround; rely on generic implementation. Be sure to copy result of nl_langinfo into local buffer. -- Chuck --------------050209000709030203040705 Content-Type: application/x-patch; name="libiconv-1.13.1-2.wchar.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="libiconv-1.13.1-2.wchar.patch" LS0tIGxpYmljb252LTEuMTMuMS5vcmlnL2xpYi9pY29udi5jCTIwMDktMDYt MjEgMTM6MTc6MzMuMDAwMDAwMDAwICswMjAwCisrKyBsaWJpY29udi0xLjEz LjEvbGliL2ljb252LmMJMjAxMS0wMS0yNyAxMjo0NjoyMS41NDQyOTYyODEg KzAxMDAKQEAgLTU1MCw3ICs1NTAsNyBAQCBjb25zdCBjaGFyICogaWNvbnZf Y2Fub25pY2FsaXplIChjb25zdCBjCiAgICAgaWYgKGFwLT5lbmNvZGluZ19p bmRleCA9PSBlaV9sb2NhbF93Y2hhcl90KSB7CiAgICAgICAvKiBPbiBzeXN0 ZW1zIHdoaWNoIGRl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tIGRvdF0gPSAnXDAnOwotCQkgIHJldHVybiBidWY7Ci0JCX0KLQkgICAg fQotCX0KLQotICAgICAgLyogV29lMzIgaGFzIGEgZnVuY3Rpb24gcmV0dXJu aW5nIHRoZSBsb2NhbGUncyBjb2RlcGFnZSBhcyBhIG51bWJlci4gICovCi0g ICAgICBzcHJpbnRmIChidWYsICJDUCV1IiwgR2V0QUNQICgpKTsKLSAgICAg IGNvZGVzZXQgPSBidWY7Ci0gICAgfQotIyAgZW5kaWYKKyAgY29kZXNldF9i dWZbMF0gPSAnXDAnOworICBjb2Rlc2V0ID0gc3RybmNhdCAoY29kZXNldF9i dWYsIG5sX2xhbmdpbmZvIChDT0RFU0VUKSwgc2l6ZW9mIChjb2Rlc2V0X2J1 ZikpOwogCiAjIGVsc2UKIAo= --------------050209000709030203040705 Content-Type: text/plain; charset=us-ascii -- 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 --------------050209000709030203040705--