bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gawk: length return incorrect value when MB_CUR_MAX > 1


From: Paul Eggert
Subject: Re: gawk: length return incorrect value when MB_CUR_MAX > 1
Date: Thu, 01 Dec 2005 11:40:17 -0800
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

Aharon Robbins <address@hidden> writes:

>> I found mbrtowc() store L'\0' to &wc when detect '\0'.
>
> Is this portable behavior? I.e., defined by the ISO C standard?

Yes.  You can find this in
<http://www.opengroup.org/onlinepubs/009695399/functions/mbtowc.html>
The wording there differs from the C standard, but it boils down to
the same thing once you remove the mentions of POSIX notions like
LC_ALL.

The first paragraph of the DESCRIPTION section says that the value of
the wide-character code corresponding to the null byte is 0, and that
mbrtowc must store the wide-character code in the object pointed to by
the first argument.

I don't know of any mbrtowc implementations that disagree with the
standard here.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]