This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Pointer to invalid multibyte sequence in mbsnrtowcs()


On 12/20/2016 02:17 AM, Igor Liferenko wrote:
Hi Florian,

      setlocale(LC_CTYPE, "en_US.UTF-8");
      char *s = "\321\216\321";

I'm not sure if this example demonstrates the behavior you describe
because the string starts with an invalid multibyte sequence

\321\216 is a valid UTF-8 code of U+044E (CYRILLIC SMALL LETTER YU)
Besides, "status: 1" in the output of the example means that one wide
character was successfully converted.

Do you know why in Example 2 *src is unchanged?

Can you report this as a bug so that it does not get lost? It does look like we need to fix this.

Thanks,
Florian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]