rrdtool-1.3.1 don't display chinese ?

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
angelfire007
Posts: 49
Joined: Fri Dec 15, 2006 9:14 am

rrdtool-1.3.1 don't display chinese ?

Post by angelfire007 »

hi guys

I update rrdtools form 1.0.5 to 1.3.1 for display chinese.

update is ok and the picture display good . so I want rrdtool to suport chinese,
because my cacti can display chinese besides the traffic picture don't like the pic ,

so I modify the file :

vi rrd_graph.c

delete this line // setlocale(LC_TIME,"");
# ifdef HAVE_MBSTOWCS
modify this line setlocale(LC_ALL,"zh_CN");

by the Document of www here is fininshed ,but my pic do not display chinese in corrent?

the red circle is garbled but the blue circle is ok , why ?

thank for help .
Attachments
chinese error.JPG
chinese error.JPG (42.35 KiB) Viewed 2866 times
angelfire007
Posts: 49
Joined: Fri Dec 15, 2006 9:14 am

Post by angelfire007 »

so,I change the rrdtool-1.2.26 and ./configure make make install ,

and the names of Data Sources is garbled too
the picture data sources.jpg


[root@monitor]# locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=zh_CN:GB18030
LC_CTYPE="zh_CN:GB18030"
LC_NUMERIC="zh_CN:GB18030"
LC_TIME="zh_CN:GB18030"
LC_COLLATE="zh_CN:GB18030"
LC_MONETARY="zh_CN:GB18030"
LC_MESSAGES="zh_CN:GB18030"
LC_PAPER="zh_CN:GB18030"
LC_NAME="zh_CN:GB18030"
LC_ADDRESS="zh_CN:GB18030"
LC_TELEPHONE="zh_CN:GB18030"
LC_MEASUREMENT="zh_CN:GB18030"
LC_IDENTIFICATION="zh_CN:GB18030"
LC_ALL=



when edited file /usr/local/rrdtool-1.2.26/src/rrd_graph.c

./configure is ok and make; make install produced the error

cd perl-piped && make
make[4]: Entering directory `/usr/local/rrdtool-1.2.26/bindings/perl-piped'
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "zh_CN:GB18030"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
make[4]: Leaving directory `/usr/local/rrdtool-1.2.26/bindings/perl-piped'
cd perl-shared && make


now , plase view the picture rrdtool-1.2.26.jpg the blue circle, became english ?



some big man know the reason ? tks
Attachments
data sources.JPG
data sources.JPG (21.5 KiB) Viewed 2851 times
rrdtool-.1.2.26.JPG
rrdtool-.1.2.26.JPG (35.28 KiB) Viewed 2851 times
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Is your database encoded UTF8 or Latin? It must be encoded UTF8 for sure.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
angelfire007
Posts: 49
Joined: Fri Dec 15, 2006 9:14 am

Post by angelfire007 »

frist, tks agein

and the encoded like this

mysql> status
--------------
./mysql Ver 14.7 Distrib 4.1.22, for pc-linux-gnu (i686) using readline 4.3

Connection id: 54972
Current database:
Current user: cactiuser@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 4.1.22-standard-log
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: latin1
Db characterset: latin1
Client characterset: utf8
Conn. characterset: utf8
UNIX socket: /tmp/mysql.sock


then,I change server characterset and db characterset to uft8 but no help to my problem.

tks
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Sorry, you dont understand, if you execute the following command, what do you get?

Code: Select all

show create table cdef
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
angelfire007
Posts: 49
Joined: Fri Dec 15, 2006 9:14 am

Post by angelfire007 »

ho, I'm a network engineer, in soft , i'm a beginer .

in mysql database cacti

mysql> show create table cdef
-> ;
+-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| cdef | CREATE TABLE `cdef` (
`id` mediumint(8) unsigned NOT NULL auto_increment,
`hash` varchar(32) NOT NULL default '',
`name` varchar(255) NOT NULL default '',
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=23 DEFAULT CHARSET=latin1 |
+-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.01 sec)

mysql>

what shall i do ? thank you again
angelfire007
Posts: 49
Joined: Fri Dec 15, 2006 9:14 am

Post by angelfire007 »

so, I connect mysql database by sevureCRT
and ,I do this:

mysql> create table a(name varchar(10));
Query OK, 0 rows affected (0.02 sec)

mysql> insert into a values('完全');
Query OK, 1 row affected (0.00 sec)

mysql> select * from a;
+------+
| name |
+------+
| 完全 |
+------+
1 row in set (0.00 sec)

mysql> show create table a;
+-------+---------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+---------------------------------------------------------------------------------------------+
| a | CREATE TABLE `a` (
`name` varchar(10) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
+-------+---------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
angelfire007
Posts: 49
Joined: Fri Dec 15, 2006 9:14 am

Post by angelfire007 »

and I find some docments form internet . say:

CREATE DATABASE dbname DEFAULT CHARACTER SET utf8 COLLATE gbk_chinese_ci

means when establishing the tables we need to specify the utf8 character set

I don't know how to do that ?

tks again .
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

You have to:

1) Dump your database using mysqldump
2) Edit the dump and change the type to UTF8
3) Re-Import.

I am uncertain what will happen with characters that were looking "good" with Latin1 and are re-imported with UTF8 though. You may have more work on your hands.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
angelfire007
Posts: 49
Joined: Fri Dec 15, 2006 9:14 am

Post by angelfire007 »

I understand, but I think dump database and edit it is too dangerous , so I maybe install a vm workstation to test .

finally, thank you for your help .
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests