[dev.icinga.com #8723] utf8 isn't displayed in COMMENT_DATA #1346
Comments
Updated by mfrosch on 2015-03-12 15:08:49 +00:00
|
Updated by mfrosch on 2015-03-12 15:09:42 +00:00 This is a problem of the Icinga Core, which does not write the UTF-8 code into the database. It also seems to happen with Icinga2... (tested with 2.2.4) The data is written correctly into the status.dat and displayed in ClassicUI |
Updated by mfriedrich on 2015-03-12 16:55:56 +00:00
That's a schema problem which is not easy to change nor fix. See #2389 for details. |
Updated by mfriedrich on 2015-03-12 16:56:09 +00:00
|
Updated by leo9641 on 2015-03-13 10:30:21 +00:00 Yes, but I configured mysql-server default encoding in utf-8: character-set-server=utf8 And icinga_comments had correct string in database in this case. But icinga-web (php) don't show this comment. lazyfrosch wrote:
|
Updated by mfriedrich on 2015-03-13 12:21:24 +00:00
Ok. Then I'll move it back to Icinga Web 1.x |
Updated by berk on 2015-05-18 12:18:16 +00:00
|
This issue has been migrated from Redmine: https://dev.icinga.com/issues/8723
Created by mfrosch on 2015-03-12 15:08:48 +00:00
Assignee: (none)
Status: New
Target Version: Backlog
Last Update: 2015-05-18 12:18:16 +00:00 (in Redmine)
Hi!
I installed icinga-1.11.7 and enable idomod. Created a database icinga in UTF8 :
`comment_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`instance_id` bigint(20) unsigned DEFAULT '0',
`entry_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`entry_time_usec` int(11) DEFAULT '0',
`comment_type` smallint(6) DEFAULT '0',
`entry_type` smallint(6) DEFAULT '0',
`object_id` bigint(20) unsigned DEFAULT '0',
`comment_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`internal_comment_id` bigint(20) unsigned DEFAULT '0',
`author_name` varchar(64) DEFAULT '',
`comment_data` text,
`is_persistent` smallint(6) DEFAULT '0',
`comment_source` smallint(6) DEFAULT '0',
`expires` smallint(6) DEFAULT '0',
`expiration_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`endpoint_object_id` bigint(20) DEFAULT NULL,
PRIMARY KEY (`comment_id`),
UNIQUE KEY `instance_id` (`instance_id`,`object_id`,`comment_time`,`internal_comment_id`),
KEY `comments_i_id_idx` (`instance_id`)
) ENGINE=InnoDB AUTO_INCREMENT=666 DEFAULT CHARSET=utf8 COMMENT='Usercomments on Icinga objects'
Then I installed icinga-web-1.12.0 and I found that COMMENT_DATA (and COMMENT_AUTHOR_NAME too) aren't display in UTF8.
Request for example:
/icinga-web/modules/web/simpleDataProvider/json?src_id=comments&filter
{result Admin",COMMENT_TIME 11:27:18",COMMENT_DATA "},{COMMENT_AUTHOR_NAME 14:22:09",COMMENT_DATA???"}
...skip...
I enable sql log and see:
641 Query SET NAMES utf8
641 Query SET NAMES 'utf8'
Thats ok. Then I executed inquiry from mysql:
mysql> use icinga;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> set NAMES utf8;
Query OK, 0 rows affected (0.00 sec)
mysql> SELECT * FROM icinga_comments WHERE comment_time='2014-08-13 11:27:18';
------------------------
*------------------------------------~~-------------*---------------------~~---------------------------------------------------------------------------------------------~~--------------*-----------------------~~--------------------*-------------------+| comment_id | instance_id | entry_time | entry_time_usec | comment_type | entry_type | object_id | comment_time | internal_comment_id | author_name | comment_data | is_persistent | comment_source | expires | expiration_time | endpoint_object_id |
------------------------
*------------------------------------~~-------------*---------------------~~---------------------------------------------------------------------------------------------~~--------------*-----------------------~~--------------------*-------------------+| 1 | 1 | 2014-11-20 18:11:52 | 923157 | 2 | 4 | 164 | 2014-08-13 11:27:18 | 16092 | Icinga Admin | ждем поставки памяти | 1 | 0 | 0 | 0000-00-00 00:00:00 | NULL |
------------------------
*------------------------------------~~-------------*---------------------~~---------------------------------------------------------------------------------------------~~--------------*-----------------------~~--------------------*-------------------+1 row in set (0.00 sec)
mysql>
comment_data in UTF8.
If icinga-web create the comment, it puts to database in UTF8 and I can read it from classic UI and console mysql. But I don't read my comment in icinga-web. I see only '???'
Relations:
The text was updated successfully, but these errors were encountered: