On 25 Jan 2009, at 16:25, Bill Spitzak wrote:

> All strings in FLTK are utf8 at all times.
>
> FLTK 2.0 has a utf8froma() function that will convert the strings (it
> will act as though they are ISO-8859-1). I don't know if this was put
> into fltk 1.3.

It was - I pretty much lifted the to/from translation functions from  
fltk-2 verbatim, and simply renamed them to match the fltk-1.x  
pattern somewhat.

That is, fltk-2's "utf8froma()" became fltk-1.3's "fl_utf8froma()",  
and so on.


> You can either use this when you read your data, or when
> you display it. FLTK 2.0 also has some experiments with correctly
> displaying ISO-8859-1 that is in the string, but apparently this  
> was not
> used in FLTK 1 (and that may be right, because it forces users to
> convert to UTF-8).

I think we may have enabled that functionality in fltk-1.3 too,  
actually. I know I meant to, anyway... Right or wrong.

There does seem to be a move (in so far as I think I read an RFC for  
this, regarding usage with html, but can not now find it...) towards  
assuming that any character in a nominally utf-8 text that is found  
to lie in the "awkward" U+0x80 to U+0x9F range is actually a CP-1252  
character and respond accordingly.

The reasoning being, presumably, that there are a lot of pages out  
there that claim to be utf-8 but were actually written on Windows  
machines and are actually some form of CP125x encoding, so making  
this simple assumption pretty much fixes things. Well, sort of. Or I  
could just be making this up - I am sure I did read it somewhere though!

Anyway: The same reasoning could work with a lot of files and  
filesystem entries on a computer, whether originally CP125x or  
8859-1, so that was my reasoning for that functionality in fltk... It  
is not clear that this is any use at all for text originally created  
in codepages that lie further from the utf-8 norm than (say) CP1252  
does, of course. Or that this choice (trying to translate *some*  
codepoints automagically) is actually a sensible one at all.

Feedback, suggestions and *fixes* welcome!

-- 
Ian


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

Reply via email to