Good morning specialists!

I want to use a wordwrapOutput widget. But if I insert strings to this widget 
which contains special characters like the german 'ä', 'ö' or 'ü' or maybe 
some other special ones too, than my program breaks down at this methode:

const char* Input::expand(const char* p, char* buf,int wordwrap) const {
  char* o = buf;
  char* e = buf+(MAXBUF-4);
  const char* lastspace = p;
  char* lastspace_out = o;
  int width_to_lastspace = 0;
  int word_count = 0;

  if (type() == SECRET) {
    while (o<e && p < text_+size_) {*o++ = '*'; p++;}
  } else while (o<e) {
    if (wordwrap && (p >= text_+size_ || isspace(*p))) {
      width_to_lastspace += (int)getwidth(lastspace_out, o-lastspace_out);
      if (p > lastspace+1) {
        if (word_count && width_to_lastspace > wordwrap) {
          p = lastspace; o = lastspace_out; break;
        }
        word_count++;
      }
      lastspace = p;
      lastspace_out = o;
    }
    if (p >= text_+size_) break;
    int c = *p++;
    if (c & 0xE0) {
      *o++ = c;
    } else {
      if (c == '\n' && type() >= MULTILINE) {p--; break;}
      if (c == '\t' && type() >= MULTILINE) {
        for (c = (o-buf)%8; c<8 && o<e; c++) *o++ = ' ';
      } else {
        *o++ = '^';
        *o++ = c ^ 0x40;
      }
    }
  }
  *o = 0;
  return p;
}

the exact line where my program stops is this one:

if (wordwrap && (p >= text_+size_ || isspace(*p))) {

I`m using the latest snapshot of FLTK 2.
I don`t know if I had to post this int the bug forums, because I don`t know if 
it`s a real bug, or I did sth wrong maybe ...

I hope somebody can help me.
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to