[rrd-users] Problems with locale
Andrius Narbutas
abl at xxx.lt
Tue Oct 25 01:43:16 MEST 2005
Upgraded to rrdtool 1.2.11 with hope, that i get my regional letters
shown correctly ;-) Got several problems :
a) fixed colons in code. This isn't a problem, this is described in
"major incompat." list. BUT. I didn't find anywhere mentioned, that
variables in 1.2.x can't be only digits. I used such variables in 1.0.x
version without a problem (shell script that picks users from db, finds
rrd and draws graphs, so easiest way to implement this - start a counter
and use it as variable ;-) - but now my scripts stopped working. Take a
look :
rrdtool graph img.png --start -86400 --imgformat PNG --step 300
DEF:1=db.rrd:Lbig:AVERAGE LINE1:1#61C323:label
This works in 1.0.x without problems, but in 1.2.x it draws only empty
horiz. line. No warnings, no errors. Just don't works as expected. Devs,
please, mention this issue somewhere in changelog ;-) It isn't hard to
change "DEF:$counter=db.rrd" to "DEF:randomstring${counter}=db.rrd" -
but how to know what to change? ;-)
This problem is now solved for me. Another...
b) So, now i can change fonts. Good. But how to change encoding? Graph :
rrdtool graph test1.png --start -86400 --imgformat PNG --title
'ąčęėįšųūž' --width 1000 --height 900 --step 300
DEF:a=db.rrd:Lbig:AVERAGE LINE1:a#61C323:ąčęėįšųūž --font
DEFAULT:11:../fonts/isocpeur.ttf --font-render-mode normal --font
TITLE:10:../fonts/verdanab.ttf
...and i get all in iso-8859-1 encoding. With debian package installed
(1.2.11-4). Maybe this package is "overpatched"? I took "vanilla"
rrdtool 1.2.11 source and build new package. Nothing changes. Build it
"standart" way - make, make install. The same. At last, rebuild patched
package - changed setlocale(LC_CTYPE,""); in rrd_graph.c to
setlocale(LC_CTYPE,"lt_LT");. Results are the same. Then i changed
locales. Previously i had lt_LT.ISO-8859-13 and lt_LT.UTF-8 compiled in.
Now purged all locale data with localepurge, removed
/usr/lib/locale/locale-archive and dpkg-reconfigure locales to
en_US.utf8, lt_LT.iso-8859-13 and lt_LT.utf-8 only. And set default
locale on system to lt_LT.UTF-8 (user locale allways was this, just LANG
variable was C, because i don't want translated stuff). Exported all
variables, LANG too. Ran rrdtool - no change. Changed text to unicode
and ran with LC_ALL=en_US.UTF-8 rrdtool ... - the same. Just i get 2
symbols instead of one, so - rrdtool uses the same locale. Tried with
different locales, exported or just set before run rrdtool; changed
fonts to default, and to "verdana", "arial" - nothing helps. I allways
get text displayed in the same encoding, independent of locale settings,
independent from font. "Patched" rrd_graph.c don't helps too. As last
resort i just straced rrdtool... And didn't find anything interesting.
One call to locale-archive, and lots of calls to /etc/localtime. Nothing
more with locale.
One strange thing - month names are displayed correctly - i mean, not
"Jun", but "Sau" (as of "Sausis" instead of "January") - but without
lithuanian letters too :/
I saw many graphs with "strange" symbols to me - greek, etc. So, rrdtool
can really show this without problems. Anyone has idea, how to track -
that i'm doing wrong?
Some info : Debian unstable (and debian stable with rrdtool compiled "by
hand" into sandbox too), it really supports mbstowcs (even configure
check tells about it), rrdtool 1.2.11. In case of symbols :
http://abl.fan.lt/t_lt.png - at left are letters rendered with rrdtool,
right side - how they should look (just another spacing, the same font)
If something has ideas, how to trace where rrdtool fallbacks to latin1 -
please write ;-)
Thanks. And sorry for incorrect english :/
P.S. there are more issues that differs from 1.0.x - for example, graph
rendered with "--slope-mode --no-gridfit" differs in size (total) from
graph rendered only with "--slope-mode" or "--no-gridfit" or without any
of thosem but, i think, they should go into devel list....
--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive http://lists.ee.ethz.ch/rrd-users
WebAdmin http://lists.ee.ethz.ch/lsg2.cgi
More information about the rrd-users
mailing list