[cairo] Surface error not set when using cairo_show_text() with invalid utf8
cairouser at yahoo.com
Tue Nov 2 14:32:57 PDT 2010
Bill Spitzak wrote:
> Maarten Bosmans wrote:
>> Why wouldn't one use any of the existing validation/conversion routines?
> Yes a programmer can call this if they want to detect errors. That has
> nothing to do with the problem. Maybe if we are really, really, really
> lucky, the programmer might call a useful function that preserves
> UTF-8 (but there is no "convert this UTF-8 to the closest possible
> valid form" call in that library so I am afraid it will not happen).
:) Why use this when cairo has it's very own utf8 check which
1) may or may not be the same as this one
2) does not require getting the entire glib and gnome in for something
3) is a double work, because that function in cairo is going to be
called in about 10 more instructions
Why do you need to have something in cairo to validate utf8 if it is
expected that a caller has to do so? It really should be one or the other.
> Let me make another suggestion: lets add a "set the cairo error if
> there is an error in this UTF-8" function, and fix the drawing like I
> suggest. Then the users who want the current behavior can do these two
FWIW this sounds like a good idea.
More information about the cairo