|
From: Allin C. <cot...@wf...> - 2007-11-24 01:28:41
|
I believe there are a couple of things not quite right with the encoding to UTF-8 in the context of the cairo-based terminals. * In gp_cairo_convert() (gp_cairo.c) there's an *unconditional* conversion of an input string, from the charset returned by gp_cairo_get_encoding() to UTF-8. I'd suggest that conversion should be conditional on failure of g_utf8_validate() on the string in question. Rationale: the supposed source charset may not be correct (see below). If the string validates as UTF-8 it should be passed as is. You get bamboozling error messages if g_convert() is called on a string that's already in UTF-8, but is misrepresented as being in some other encoding. * The function gp_cairo_get_encoding() doesn't work properly unless the right encoding has been set explicitly by the user. The fallback in that function is g_get_charset(), but this won't do anything useful, in the sense of identifying the character set actually in use on the given system, unless there has been a prior call setlocale (LC_ALL, ""); -- Allin Cottrell Department of Economics Wake Forest University, NC |