public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Charles Wilson <cygwin@cwilson.fastmail.fm>
To: cygwin@cygwin.com, bug-gnulib <bug-gnulib@gnu.org>
Subject: Re: Bug in libiconv?
Date: Wed, 02 Feb 2011 22:57:00 -0000	[thread overview]
Message-ID: <4D49E13C.9020406@cwilson.fastmail.fm> (raw)
In-Reply-To: <20110202211957.GM2675@calimero.vinschen.de>

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 <cygwin/version.h>
+#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

  parent reply	other threads:[~2011-02-02 22:57 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-02 18:58 Bruno Haible
2011-02-02 21:20 ` Corinna Vinschen
2011-02-02 21:35   ` bug#7971: Acknowledgement (Bug in libiconv?) GNU bug Tracking System
2011-02-02 22:57   ` Charles Wilson [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-01-29  2:15 Bug in libiconv? Bruno Haible
2011-01-29 12:34 ` Charles Wilson
2011-01-29 13:20 ` Charles Wilson
2011-01-29 17:15   ` Corinna Vinschen
2011-01-29 16:02 ` Corinna Vinschen
2011-01-29 17:51   ` Eric Blake
2011-01-29 18:12     ` Corinna Vinschen
2011-01-29 18:28       ` Eric Blake
2011-01-30 11:34         ` Corinna Vinschen
2011-01-30 11:43           ` Corinna Vinschen
2011-01-30  2:40     ` Corinna Vinschen
2011-01-27 16:06 simrw
2011-01-26 13:39 simrw
2011-01-26 13:50 ` Corinna Vinschen
2011-01-26 17:01   ` Charles Wilson
2011-01-26 22:39     ` Corinna Vinschen
2011-01-25  6:36 Corinna Vinschen
2011-01-25 11:15 ` Charles Wilson
2011-01-25 15:04   ` Corinna Vinschen
2011-01-25 18:58     ` Charles Wilson
2011-01-25 20:11       ` Corinna Vinschen
2011-01-28 22:13         ` Charles Wilson
2011-01-27  5:46     ` Charles Wilson
2011-01-27 16:05       ` Corinna Vinschen
2011-01-27 17:18         ` Charles Wilson
2011-01-27  3:53   ` Charles Wilson
2011-01-27 16:21     ` Corinna Vinschen
2011-01-27 17:39       ` Charles Wilson
2011-01-27 18:05         ` Corinna Vinschen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D49E13C.9020406@cwilson.fastmail.fm \
    --to=cygwin@cwilson.fastmail.fm \
    --cc=bug-gnulib@gnu.org \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).