AnsweredAssumed Answered

Encoding problem

Question asked by hael on Mar 7, 2008
I use alfresco-community 2.1.0 with php library. I have a new content model with new properties. I set property values via php api but if i type hungarian special characters like ő,ű, it saves QQQ into mysql instead of őőő

There was the same problem at alfresco webclient interface until i set following into my.cnf:

init_connect='SET collation_connection = utf8_general_ci'
init_connect='SET NAMES utf8'

But it's wrong throught repository service.

$statement variable at Alfresco/Service/Session.php has correct utf8 value before update.
$result = $this->repositoryService->update(array("statements" => $statements));

My settings:


port        = 3306
socket      = /var/run/mysqld/mysqld.sock


init_connect='SET collation_connection = utf8_general_ci'
init_connect='SET NAMES utf8'
character-set-server = utf8
collation-server = utf8_general_ci

mysql> status;
mysql  Ver 14.12 Distrib 5.0.45, for pc-linux-gnu (i486) using readline 5.2

Connection id:          28402
Current database:       alfresco
Current user:           root@localhost
SSL:                    Not in use
Current pager:          stdout
Using outfile:          ''
Using delimiter:        ;
Server version:         5.0.45-Debian_1ubuntu3 Debian etch distribution
Protocol version:       10
Connection:             Localhost via UNIX socket
Server characterset:    utf8
Db     characterset:    utf8
Client characterset:    utf8
Conn.  characterset:    utf8

—- Table structure for table `alf_node_properties`–
DROP TABLE IF EXISTS `alf_node_properties`;
CREATE TABLE `alf_node_properties` (
`node_id` bigint(20) NOT NULL,
`actual_type` varchar(15) NOT NULL,
`multi_valued` bit(1) NOT NULL,
`persisted_type` varchar(15) NOT NULL,
`boolean_value` bit(1) default NULL,
`long_value` bigint(20) default NULL,
`float_value` float default NULL,
`double_value` double default NULL,
`string_value` text,
`attribute_value` bigint(20) default NULL,
`serializable_value` blob,
`qname` varchar(200) NOT NULL,
  PRIMARY KEY  (`node_id`,`qname`),
  KEY `FK7D4CF8EC7F2C8017` (`node_id`),
  KEY `FK7D4CF8EC40E780DC` (`attribute_value`),
  CONSTRAINT `FK7D4CF8EC40E780DC` FOREIGN KEY (`attribute_value`) REFERENCES `alf_attributes` (`id`),
  CONSTRAINT `FK7D4CF8EC7F2C8017` FOREIGN KEY (`node_id`) REFERENCES `alf_node` (`id`)


Please HELP!!!