[cairo] non-ascii output

Carl Worth cworth at cworth.org
Thu May 19 11:25:06 PDT 2005


On Wed, 18 May 2005 13:20:11 -0700, Bill Spitzak wrote:
> An acceptable solution would be to draw an error glyph for each byte in 
> the bad UTF-8.

There are two good things that cairo should do to help programmers
when there are programming errors:

1) Make it obvious that there is an error

2) Make it obvious where the error is in the program

An idea like a (very ugly) error glyph per byte, (as opposed to an
entire string being invisible), certainly does help with #2.
In general, cairo is currently quite broken with respect to #2. What
I'd like to do is first make the implementation go through a function
call whenever setting cr->status to a non-success value. Then we'll
have a hook to do whatever we might want to do in that function, (spew
on stderr, save a stack trace the user can query, etc.).

That will help the user of cairo locate their own errors. There might
still be something else we want to help cairo coders when debugging
cairo itself.

> My proposed makes switching to UTF-8 trivial. But it also allows a sort 
> of "compressed" UTF-8 where the illegal encodings are used on purpose. 
> It certainly has been proven that programmers will take advantage of 
> this, even if told it is a bad idea.

Through selective quoting, I see:

	"it allows a ... proven ... bad idea"

End of story? :-)

-Carl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050519/eaa232b1/attachment.pgp


More information about the cairo mailing list