On 08.04.2011 07:21, chris wrote:

>> Note that the crash is not really a crash, its an unhandled thrown exception
>> from the NsWindow objc class I think. ("objc_exception_throw")
>>
>> Perhaps this exception is trying to tell us the string is invalid UTF-8
>> or some such, and is maybe something we should be trapping or something.
>
> Googling around:
> http://omegadelta.net/2011/02/10/objective-c-and-invalid-utf-8-byte-sequences/
>
>> Sounds like an STR should be made with a small test program with "\xc2\xb1"
>> as the tooltip (or perhaps even a regular label string could trigger it).
>
> 'C2B1' would be the correct UTF8 for the plusminus sign (U+00B1). The 
> problematic .fl file contains only 'B1'!

Then the .fl file is illegal/unsupported and should be converted to
UTF-8, but ...

The following should probably go to fltk.development...

We're now *again* at the point where we must decide how much we try to
support illegal UTF-8 sequences. AFAICT they are well supported on
Windows and X11 with XFT, but not on X11 w/o XFT (usually we (try to)
interpret the failing sequences as CP-1252). Now we see that we also
have problems on Mac OS X. However, on Mac OS the "natural" character
encoding is (was) MacRoman, so that this will often show the /wrong/
glyph when using for instance .fl files that have been created in the
past (for FLTK 1.1 etc.) or embedded strings, edited on a Mac for
use in FLTK 1.1.

I don't have a solution. Using our own UTF-8 to UTF-16 conversion
functions (that replace illegal characters in a consistent way -
maybe) and rendering UTF-16 sequences /might/ be a way to go. If
this would be done consistently on all platforms, then this would
also make the code (embedded strings) and .fl files more portable,
too (without requiring to convert all strings to UTF-8). IIRC, this
is done on Windows and X11/XFT already.

That said, converting the /input/ strings to UTF-8 should be the
way to go for all program developers, anyway, but what FLTK does
internally (to fix this, if not done) is another point.

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

Reply via email to