This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: [skimo@kotnet.org] libc/2302: putwc doesn't work in glibc 2.2.3
- To: Andreas Jaeger <aj at suse dot de>
- Subject: Re: [skimo@kotnet.org] libc/2302: putwc doesn't work in glibc 2.2.3
- From: Sven Verdoolaege <skimo at kotnet dot org>
- Date: Mon, 4 Jun 2001 10:56:37 +0200
- Cc: libc-alpha at sources dot redhat dot com
- References: <u8elt07hx1.fsf@gromit.moeb>
On Mon, Jun 04, 2001 at 10:44:58AM +0200, Andreas Jaeger wrote:
>
> Hi,
>
> can anybody comment on this bug report, please?
>
I can add that the problem seems to be the combination of
narrow character output (puts in the example) with wide
character output (putwc).
Is this somehow not allowed ?
And I noticed that I put 8bit characters in my example program,
which probably wasn't a good idea, so here is the same program
again without them:
#include <wchar.h>
#include <stdlib.h>
#include <locale.h>
#include <unistd.h>
#include <stdio.h>
int main(void)
{
wchar_t wc[20], *wp;
setlocale(LC_ALL, "");
puts("");
mbstowcs(wc, "Espa\303\261ol", 20);
for (wp = wc; *wp; ++wp) {
putwc(*wp, stdout);
}
puts("");
fflush(stdout);
}
skimo