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?
UTF-8 in graph titles - solved
Moderators: Developers, Moderators
UTF-8 in graph titles - solved
Last edited by slavko on Sat Oct 02, 2010 10:16 am, edited 1 time in total.
Re: UTF-8 in graph titles
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:
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.
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
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.
Who is online
Users browsing this forum: No registered users and 0 guests