bug-gnu-libiconv
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-gnu-libiconv] Re: Bug in libiconv?


From: Charles Wilson
Subject: [bug-gnu-libiconv] Re: Bug in libiconv?
Date: Fri, 28 Jan 2011 21:32:16 -0500
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

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

Attachment: libiconv-1.13.1-2.wchar.patch
Description: Source code patch


reply via email to

[Prev in Thread] Current Thread [Next in Thread]