delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/07/20/08:21:29

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_SOFTFAIL
X-Spam-Check-By: sourceware.org
Message-ID: <4A646145.8000701@byu.net>
Date: Mon, 20 Jul 2009 06:21:25 -0600
From: Eric Blake <ebb9 AT byu DOT net>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.22) Gecko/20090605 Thunderbird/2.0.0.22 Mnenhy/0.7.6.666
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: mbrtowc bug
References: <4A6451C0 DOT 9050504 AT byu DOT net> <20090720114240 DOT GB30066 AT calimero DOT vinschen DOT de> <20090720115529 DOT GC30066 AT calimero DOT vinschen DOT de> <4A645C07 DOT 4090501 AT byu DOT net> <20090720120833 DOT GF30066 AT calimero DOT vinschen DOT de>
In-Reply-To: <20090720120833.GF30066@calimero.vinschen.de>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Corinna Vinschen on 7/20/2009 6:08 AM:
> I'm running the testcase on XP SP3.  I have an idea why it fails for
> you.  The eucJP codepage 20932 is not installed by default on US and
> other western language systems by default up to Windows 2003.  What you
> have to do is, open the "Regional and Language Options" control panel,
> go to the "Advanced" tab, scroll the "Code page conversion tables" list
> down to the 20932 entry, select it and install it.
> 
> This is not necessary anymore startying with Vista, which comes with
> almost all important conversion tables preinstalled.

Hmm.  That means we should probably teach setlocale to fail when trying to
select an eucJP codeset if we detect that the eucJP tables are not (yet)
installed.  The current situation for packages that use gnulib and gettext
(such as coreutils, tar, findutils, ...) is that:

if I build a cygwin package on a system with the code page installed, the
gnulib test passes, and gnulib does not inject any replacement code.
However, this build could fail in an unpredictable manner if installed on
a user's machine that lacks the code page, because users can select the
charset without any error indication.

if I build a cygwin package on a system without the code page, the gnulib
test fails, so gnulib injects replacement code.  This build will work on
all user's machines, but contains a lot of code bloat for users that have
the code page installed.


Changing the situation to make setlocale reject unsupported charsets would
mean:

if I build a cygwin package on a system with the code page installed, the
gnulib test passes, and no code is injected.

if I build a cygwin package on a system without the code page, the gnulib
test skips, but knows (or can be taught) to assume that cygwin's mbrtowc
is not broken, so no replacement code is injected.

either way, users with the code page have a minimal binary size, and users
without the code page can't use the locale in the first place, so they
don't have any problems.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9 AT byu DOT net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkpkYUQACgkQ84KuGfSFAYCTQgCgrUFRy9pAL8uV4HfV2WL1ZEX2
IYsAnAsAqStHhtAiTMBcvVEJlVc8YUKs
=xSRD
-----END PGP SIGNATURE-----

--
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019