Greg Ercolano wrote:
> I think the 0xA0 character might be the problem here.
> A0 being the hi bit set equivalent of an ascii space.

    qiaogang chen, I compiled the below, slightly modified program
    on my Vista machine with FLTK 1.3.x, and when I run it, it shows
    this image:
    http://seriss.com/people/erco/fltk/tmp/chinese-bad-character.jpg

    Can you look at that image and confirm the red underlined character
    is the /only/ problem here?

    Since I don't know Chinese, would you say that single "c" character
    is the *only* problem with the screenshot above?

    And further more, can you confirm the window title looks completely
    correct, and the problem is ONLY in the FLTK widgets?

    Confirming this would seem to help nail down my suspicion
    that the \xa0 character is the problem here, as that character
    is part of the sequence that defines that red problem character.

//////////////////////////////////////////////////////////////////

#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Box.H>
#include <FL/Fl_Menu_Bar.H>
#include <stdlib.h>

int main(int argc, char **argv)
{
    // Chinese utf8 text from Qiaogang Chen
    char *utf8str 
="\xef\xbb\xbf\x20\x20\x31\x20\xe5\xb9\xbf\xe8\xa5\xbf\xe5\x8c\x97\xe9\x83"
                   
"\xa8\xe6\xb9\xbe\xe6\xb5\xb7\xe5\x9f\x9f\xe6\xb5\xb7\xe4\xb8\x8a\xe6\xb2"
                   
"\xbb\xe5\xae\x89\xe5\x9f\xba\xe7\xa1\x80\xe4\xbf\xa1\xe6\x81\xaf\xe7\xb3"
                   
"\xbb\xe7\xbb\x9f\x32\x20\xe7\xae\xa1\xe7\x90\x86\x33\x20\xe7\xae\xa1\xe7"
                   
"\x90\x86\xe6\xb8\xaf\xe5\x8f\xa3\xe7\xa0\x81\xe5\xa4\xb4\x34\x20\xe7\xae"
                   
"\xa1\xe7\x90\x86\xe5\x85\xbb\xe6\xae\x96\xe5\x9c\xba\x35\x20\xe7\xae\xa1"
                   
"\xe7\x90\x86\xe6\xb8\x94\xe8\x88\xb9\x36\x20\xe7\xae\xa1\xe7\x90\x86\xe6"
                   
"\xb8\x94\xe6\xb0\x91\x37\x20\xe7\xb3\xbb\xe7\xbb\x9f\x38\x20\xe5\xb8\xae"
                   "\xe5\x8a\xa9\x39\x20\xe9\x80\x80\xe5\x87\xba";

    printf("UTF8STR=<%s>\n", utf8str);

    // WINDOW
    Fl_Window *window = new Fl_Window(1000,180,utf8str);

    // BOX
    {
      Fl_Box *box = new Fl_Box(FL_UP_BOX,20,40,1000-40,100, utf8str);
      box->labelsize(16);
      box->labeltype(FL_SHADOW_LABEL);
    }

    // MENUBAR
    {
      Fl_Menu_Bar *bar = new Fl_Menu_Bar(0,0,500,25);
      char *menuname = (char*)malloc(strlen(utf8str) + strlen("File/") + 2);
      strcpy(menuname, "File/");
      strcat(menuname, utf8str);
      bar->add(menuname);
    }
    window->end();
    window->show(argc, argv);
    return Fl::run();
}

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

Reply via email to