[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: BUG REPORT: glibc 2.2 mbrtowc() fails to decode final byte
From: |
Andreas Jaeger |
Subject: |
Re: BUG REPORT: glibc 2.2 mbrtowc() fails to decode final byte |
Date: |
10 Jan 2001 21:53:37 +0100 |
User-agent: |
Gnus/5.090001 (Oort Gnus v0.01) XEmacs/21.1 (Channel Islands) |
>>>>> Markus Kuhn writes:
> The following regression test fails in glibc 2.2 under linux-i386:
> -------------------------------------------------------------------
> #include <stdio.h>
> #include <stdlib.h>
> #include <errno.h>
> #include <assert.h>
> #include <wchar.h>
> #include <locale.h>
> int main() {
> // UTF-8 single byte feeding test for mbrtowc()
> wchar_t wc;
> mbstate_t s;
> char *locale = "en_GB.UTF-8";
> if (!setlocale(LC_CTYPE,locale)) {
> fprintf(stderr, "locale '%s' not available!\n", locale);
> exit(1);
> }
> wc = 42; /* arbitrary number */
> assert(mbrtowc(NULL, NULL, 0, &s) == 0); /* get s into initial state */
> assert(mbrtowc(&wc, "", 1, &s) == 0); /* test final byte processing */
> assert(wc == 0); /* test final byte decoding */
> return 0;
> }
> -------------------------------------------------------------------
It seems that this is fixed in the current pre release. Can I add
your program to the glibc test suite? I guess it would I can change
the locale to de_DE.UTF-8 (that makes integration in the test suite
easier ;-).
Andreas
--
Andreas Jaeger
SuSE Labs address@hidden
private address@hidden
http://www.suse.de/~aj