> Well, so far, for solving the STR-2158 problems at least, I had only
> identified one place where fl_wcwidth() would be needed, and seeing
> as you have to call fl_utf8decode() to get the ucs value to 
> pass to fl_wcwidth(), the extra testing is already done in 
> fl_utf8decode().

Ah. OK.
I was thinking of the general case, of course, where someone might call
fl_wcwidth() directly, and was wanting to be "safe"...
But since it will likely be called *a lot* we would want to make it as
light as possible, so minimising tests (especially where we know they
will already have been done!) is a Good Thing.

And you are right - we maybe do not want to expose a UCS interface, but
keep all the interfaces utf8.


> [Hmm. Now I look at it, it probably makes sense to simplify this code
> further by also providing an "fl_wcwidth(const char* src)" version
> which does the decoding too.]

OK - I think I quite like that; it takes the "un-decoded" utf8 and tells
you the glyph width. Seems good.

Or... Some extended version that returns both the decoded utf8 *and* the
width in one fell swoop...?

-- 
Ian
SELEX Galileo Ltd
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-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to