Hello Thomas,
Apologies for the late response to your report.

On 7/21/2025 8:25 PM, Thomas Wolff via Cygwin wrote:
mbrtowc is broken in 3.6.4 which breaks non-BMP display in mintty.
Test case below.
Thomas

#include <locale.h>
#include <wchar.h>
#include <stdio.h>

void mb(unsigned char c)
{
   wchar_t wc;
   int ret = mbrtowc(&wc, &c, 1, 0);
   printf("%02X -> %04X : %d\n", c, wc, ret);
}

void main ()
{
   setlocale (LC_CTYPE, "");

   mb(0xF0);
   mb(0x9F);
   mb(0x98);
   mb(0x8E);
}

Running your testcase gives different output between 3.6.4 and 3.7.0-dev-139 but I'm unsure the latter is correct. Can you comment please?

On 3.6.4:
~ ./a
F0 -> 0000 : -2
9F -> 0000 : -2
98 -> 0000 : -2
8E -> D83D : 3

On 3.7.0-dev-139:
~ ./a
F0 -> 0000 : -2
9F -> 0000 : -2
98 -> D83D : 1
8E -> DE0E : 1

Thanks much,

..mark

--
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

Reply via email to