|
From: Allin C. <cot...@wf...> - 2007-11-24 02:23:10
|
On Fri, 23 Nov 2007, Ethan A Merritt wrote: > > * 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, ""); > > Isn't there one already? > Or at any rate a call to setlocale(LC_CTYPE, "")? > When I enter gnuplot it correctly knows about the locale: > > lascaux [1235] ./gnuplot... > gnuplot> show locale > > LC_CTYPE is en_US.UTF-8 > LC_TIME is C That's what I see here too, but g_get_charset(), called in gp_cairo.c, is getting ANSI_X3.4-1968 (ascii). The GLib reference says, "A number of interfaces in GLib depend on the current locale in which an application is running. Therefore, most GLib-using applications should call setlocale (LC_ALL, "") to set up the current locale." I tried sticking that exact invocation into gp_cairo.c, prior to the call to g_get_charset, and the latter then found UTF-8 OK. Allin Cottrell |