|
From: Allin C. <cot...@wf...> - 2007-11-25 02:01:02
|
On Sat, 24 Nov 2007, Ethan A Merritt wrote: > On Saturday 24 November 2007 11:05, Timothée Lecomte wrote: > > Allin Cottrell a écrit : > > >> I am thinking that regardless of any possible bugs in the cairo > > >> processing, we should be consistent and always call > > >> setlocale(LC_CTYPE,""). > > > That makes sense to me: maybe in init_locale? > > I agree with that. Why not LC_ALL by the way ? > > OK. I have added setlocale(LC_CTYPE,"") to init_locale(). > I also added Allin's pre-validation of strings to see if they conform > to UTF-8. The test doesn't really prove the string is UTF-8, but I > can't think of any non-contrived cases where this would be a problem. Thank you for doing that. > Neither of these patches are strictly speaking necessary. The > same result could be accomplished by putting "set encoding > locale" in ~/.gnuplot. Not quite the same. One of the attractions of a target that accepts UTF-8 is that files intended for that target and encoded in UTF-8 can be shared across platforms, regardless of the local encoding. For instance if I'm on an ISO-88959-1 platform and I download a UTF-8-encoded gnuplot source file to generate a plot using one of the cairo-based terminals, it should now work fine. Before, it would fail with a confusing error message (probably a different confusing error message depending on whether or not I had "set encoding locale" in my ~/.gnuplot). Allin Cottrell |