UTF-8 in graph titles - solved

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
slavko
Posts: 4
Joined: Fri Oct 01, 2010 1:52 pm

UTF-8 in graph titles - solved

Post by slavko »

After upgrade cacti to 0.8.7g on Debian Squeeze (testing) i see missing all non-ASCII characters in graph titles. All text outputs from database (graph titles and others) are OK, but graph titles are withouts this chars.

I inspect MySQL and Apache settings and both has default chracter set as UTF-8, system is in UTF-8 too, but:

1, in Graph management list is Graph title showed as: "Localhost - Využitie pamäte"
2, in cacti.graph_templates_graph table it is as: "Localhost - Využitie pamäte"
3, in the Graph Debug Mode RRDTool Command it is as: "--title='Localhost - Vyuitie pamte' \"
4, and finaly in graph image it is as: "Localhost - Vyuitie pamte" too.

I try play with database, but when i change these characters directly in DB by phpadmin to proper characters, in graph management list i get "Localhost - Vyu�itie pam�te"...

Can someone help me to solve this, please? Which settings i have wrong? Or is it Debian/Cacti related issue?
Last edited by slavko on Sat Oct 02, 2010 10:16 am, edited 1 time in total.
slavko
Posts: 4
Joined: Fri Oct 01, 2010 1:52 pm

Re: UTF-8 in graph titles

Post by slavko »

For other searching the same problem...

After some debugging i found that this is caused by using cacti_escapeshellarg function, which manipulate the graph title for rrdtools by PHP function escapeshellarg, which strips non-ASCII (accents) characters, when locales are not UTF...

Comment on PHP manpage (http://www.php.net/manual/en/function.e ... .php#88325) tells about using proper setlocale, but when i play with this, the behavior was strange - once was characters stripped and once not...

After this i found that default Debian locale settings for Apache are in /etc/apache/envvars, where are lines:

Code: Select all

## The locale used by some modules like mod_dav                                                                           
export LANG=C                                                                                                             
## Uncomment the following line to use the system default locale instead:                                                 
#. /etc/default/locale
Uncommenting line with default system locales (and restart apache) solves the problem with graph titles with nonASCII characters, but i don't know how this affect some others tools (i have apache only for cacti and only for me).

I am not sure, if it is a cacti bug or expected feature. But IMHO, if the Cacti proper works with non-ASCII chars in other texts, it must respect these chars in rrdtool command too. Maybe using the escapeshellarg function is not proper choice for no english users.
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests