> I think the 0xA0 character might be the problem here.
> A0 being the hi bit set equivalent of an ascii space.
> 
> See my followups on the end of Ian's STR #2080 here:
> http://www.fltk.org/str.php?L2080
> 
> In short, I'm thinking some code in FLTK is folding the 0xA0
> down into an 0x20, and this might be messing up the UTF8 strings.


Yes - the fl_expand_text() function in fl_draw.cxx is taking a too
simplistic approach to string expansion. Basically it is still thinking
in ASCII, which is not acceptable.

So, if you draw a string "directly" without passing it through
fl_expand_text() then it pretty much seems to work. But if
fl_expand_text() is called (which happens automatically for widget
labels, menu items, etc...) then the input string can get munged.

Now, Fabien has a hackaround for this which is checked into the 1.3 svn
for testing - it seems to work OK but I am a little concerned that it is
still not sophisticated enough.

It would help *greatly* if everyone could give it a spin and report
their results (including the OP qiaogang chen if possible?)
The test code attached to STR 2080 is a reasonable starting place for
tests I think... But adding in any extra strings that are found to be
problematic (e.g. Greg's new Japanese samples) would be useful.

(As an aside: I have half an idea of how the "more thorough" fix would
work, but I have no code - if I ever write an "improved" version I'll
offer it up for consideration later... In the meantime, Fabien's fix is
there and seems to work.)

Note that Fabien also has a fix for window titles in OSX (inspired by a
patch by manolo I think) that corrects the observed title corruption
there. Again, testing would be a big help.

In summary - please test and let me/Fabien know how it goes...
-- 
Ian






SELEX Sensors and Airborne Systems Limited
Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 
3EL
A company registered in England & Wales.  Company no. 02426132
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************

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

Reply via email to