delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/07/20/07:55:53

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Mon, 20 Jul 2009 13:55:29 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: mbrtowc bug
Message-ID: <20090720115529.GC30066@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <4A6451C0 DOT 9050504 AT byu DOT net> <20090720114240 DOT GB30066 AT calimero DOT vinschen DOT de>
MIME-Version: 1.0
In-Reply-To: <20090720114240.GB30066@calimero.vinschen.de>
User-Agent: Mutt/1.5.19 (2009-02-20)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT 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

On Jul 20 13:42, Corinna Vinschen wrote:
> On Jul 20 05:15, Eric Blake wrote:
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> > 
> > The gnulib unit tests are declaring that cygwin's mbrtowc is broken.  STC:
> > 
> > #include <locale.h>
> > #include <string.h>
> > #include <wchar.h>
> > int main ()
> > {
> >   if (setlocale (LC_ALL, "ja_JP.eucJP") != NULL)
> >     {
> >       char input[] = "B\217\253\344\217\251\316er";
> > 
> >       mbstate_t state;
> >       wchar_t wc;
> > 
> >       memset (&state, '\0', sizeof (mbstate_t));
> >       if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
> >         {
> >           input[1] = '\0';
> >           if (mbrtowc (&wc, input + 2, 5, &state) != 2)
> >             return 1;
> >         }
> >     }
> >   return 0;
> > }
> > 
> > 
> > According to Bruno Haible[1], the bug is in the __eucjp_wctomb and
> > __eucjp_mbtowc implementations.

What bug?!?  When I run this testcase on Cygwin 1.7, it returns 0.  What
is the supposed error and what is expected if it's behaving correctly?
My japanese is a bit rusty so I don't understand the input string and
what the test is actually testing.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

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