DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2158
Version: 1.3-current


The small test program below [runs on Linux, don't know about Win/Mac]
gives the results that I expected, namely the system wcwidth() returns
-1 because I don't have a CJK-aware locale, and both the fl_wcwidth_()
and fl_wcwidth() return 2. So it looks like there's another display bug
triggered by wrap_mode(1,0) for at least some CJK characters.

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

#include <FL/Fl.H>
#include <FL/fl_utf8.h>

int main(int argc, char* argv[]) {
  char utf8[10];
  for (unsigned int ucs = 0x6653; ucs < 0x66a3; ucs++) {
    int len = fl_utf8encode(ucs, utf8);
    printf("ucs: \\x%x", ucs);
    printf("  ");
    printf("utf-8: ");
    for (int i = 0; i < len; i++)
      printf("\\x%hhx", utf8[i]);
    printf("  ");
    printf("wcwidth: %2d", wcwidth((wchar_t)ucs));
    printf("  ");
    printf("mkwidth: %2d", fl_wcwidth_(ucs));
    printf("  ");
    printf("flwidth: %2d", fl_wcwidth(utf8));
    printf("  ");
    printf("\n");
  }
  return 0;
}
</pre>


Link: http://www.fltk.org/str.php?L2158
Version: 1.3-current

_______________________________________________
fltk-bugs mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-bugs

Reply via email to