Why does here wcwidth
return "-1" (not a printable wide character) width "Ԥ" (0x0524)?
#include <stdio.h>
#include <wchar.h>
#include <locale.h>
int wcwidth(wchar_t wc);
int main()
{
setlocale(LC_CTYPE, "");
wchar_t wc1 = L'合'; // 0x5408
int width1 = wcwidth(wc1);
printf("%lc - print width: %i\n", wc1, width1);
wchar_t wc2 = L'Ԥ'; // 0x0524
int width2 = wcwidth(wc2);
printf("%lc - print width: %i\n", wc2, width2);
return 0;
}
Output:
合 - print width: 2
Ԥ - print width: -1