Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#493553: rrdtool: broken with non-UTF8 locales: Invalid UTF-8 string passed to pango_layout_set_text()

62 views
Skip to first unread message

Meelis Roos

unread,
Aug 3, 2008, 2:40:09 AM8/3/08
to
Package: rrdtool
Version: 1.3.1-2
Severity: normal


When invoking rrdtool graph in an environment with non-UTF8 locale (like
my et_EE.ISO-8859-15) it still assumes the input is UTF-8. This results
in messages like
(process:8043): Pango-WARNING **: Invalid UTF-8 string passed to pango_layout_set_text()
and broken diacritics in graph output.

Might also be a problem with pango but it seems more likely that rrdtool
is wrong here.

-- System Information:
Debian Release: lenny/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.26 (PREEMPT)
Locale: LANG=et_EE.ISO-8859-15, LC_CTYPE=et_EE.ISO-8859-15 (charmap=ISO-8859-15)
Shell: /bin/sh linked to /bin/bash

Versions of packages rrdtool depends on:
ii libc6 2.7-13 GNU C Library: Shared libraries
ii libfontconfig1 2.6.0-1 generic font configuration library
ii libpixman-1-0 0.10.0-2 pixel-manipulation library for X a
ii libpng12-0 1.2.27-1 PNG library - runtime
ii librrd4 1.3.1-2 Time-series data storage and displ
ii libx11-6 2:1.1.4-2 X11 client-side library
ii libxcb-render-util0 0.2+git41-1 utility libraries for X C Binding
ii libxcb-render0 1.1-1.1 X C Binding, render extension
ii libxcb1 1.1-1.1 X C Binding
ii libxrender1 1:0.9.4-2 X Rendering Extension client libra
ii zlib1g 1:1.2.3.3.dfsg-12 compression library - runtime

rrdtool recommends no packages.

Versions of packages rrdtool suggests:
pn librrds-perl <none> (no description available)

-- no debconf information

--
To UNSUBSCRIBE, email to debian-bugs-...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Sebastian Harl

unread,
Aug 4, 2008, 10:30:21 AM8/4/08
to
tags 493553 + patch pending
thanks

Hi,

On Sun, Aug 03, 2008 at 09:29:10AM +0300, Meelis Roos wrote:
> When invoking rrdtool graph in an environment with non-UTF8 locale (like
> my et_EE.ISO-8859-15) it still assumes the input is UTF-8. This results
> in messages like
> (process:8043): Pango-WARNING **: Invalid UTF-8 string passed to pango_layout_set_text()
> and broken diacritics in graph output.
>
> Might also be a problem with pango but it seems more likely that rrdtool
> is wrong here.

Well, imho, this is caused by some strange behavior of libpango. Anyway,
that behavior seems to be intended, so this is a bug in rrdtool. The
problem is, that pango_layout_set_text() and pango_layout_set_markup()
expect strings which are UTF-8 encoded (instead of using the encoding as
specified by the locale settings), so rrdtool has to make sure that this
is true.

The attached patch converts the given string to UTF-8 using glib's
g_locale_to_utf8() function. This function expects the string to be
encoded as specified by the locale settings, so this will fail if e.g.
you're using some script which is encoded in some way incompatible to
the locale settings. In this case, the patch falls back to use the
original string as provided by the user as there is no way to tell how
to interpret that string. So, in this case, you will still get the old
behavior (that pango warning and messed up strings in the graph).
However, imho this is perfectly fine since it should be up to the user
to take care of a sane environment.

I've just done some basic tests of that patch, so some more feedback
would be appreciated. Tobi, besides that, the patch should be fine for
inclusion in the next release of rrdtool.

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

0001-rrd_gfx.c-Convert-strings-passed-to-pango_layout_se.patch
signature.asc

Tobias Oetiker

unread,
Aug 4, 2008, 4:50:22 PM8/4/08
to
Hi Sebastian,

cool ... thanks ... I have included

cheers
tobi
Today Sebastian Harl wrote:

--
Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten, Switzerland
http://it.oetiker.ch to...@oetiker.ch ++41 62 775 9902 / sb: -9900

0 new messages