[rrd-developers] UTF-8 and pango ... again

Sebastian Harl sh at tokkee.org
Sat Aug 8 14:59:06 CEST 2009


Hi Tobi,

On Sat, Aug 08, 2009 at 02:11:37PM +0200, Tobias Oetiker wrote:
> Today Sebastian Harl wrote:
> > On Sat, Aug 08, 2009 at 11:33:56AM +0200, Tobias Oetiker wrote:
> > > Jul 21 Sebastian Harl wrote:
> > > > The following problem has been reported to me:
> > > >
> > > > When creating graphs covering one year and using something like
> > > > LANG=en_US.UTF-8 and LC_TIME="de_DE" in the environment, pango reports
> > > > the following warning:
> > > >
> > > > Pango-WARNING **: Invalid UTF-8 string passed to pango_layout_set_text()
> > >
> > > what happens when you set
> > >
> > > LC_TIME=de_DE.UTF-8
> >
> > Well, then it works fine - strftime() then generates an UTF-8 encoded
> > string which will work no matter which locale has been set.
> 
> in that case one solution might be:
> 
>  * if LC_TIME is set before calling the formating for the x-axis legend
>    - save LANG
>    - set LANG=LC_TIME
> 
> what do you think ?

That won't reliably work either. E.g. if both, LANG and LC_TIME, use
different non-UTF-8 locales then strings passed on the command line
(axis description, labels, etc.) might not be handled correctly (by
pango). We'd then have to reset LANG right after formatting the x-axis
tick labels and before handling any other text …

This sounds like a rather bad hack to me :-/ This way we'd solve this
one specific problem but the main problem (we need some reliable way to
make sure _all_ strings will be UTF-8-encoded before being passed to
pango) does not get solved and we might stumble across it again and
again. I'd much prefer to have this solved in a more generic way, if
possible. Maybe we should talk to the pango-people about this?

Cheers,
Sebastian

-- 
Sebastian "tokkee" Harl +++ GnuPG-ID: 0x8501C7FC +++ http://tokkee.org/

Those who would give up Essential Liberty to purchase a little Temporary
Safety, deserve neither Liberty nor Safety.         -- Benjamin Franklin

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
Url : http://lists.oetiker.ch/pipermail/rrd-developers/attachments/20090808/a863aa6b/attachment.bin 


More information about the rrd-developers mailing list