Project

General

Profile

Database encoding not utf-8 in default

István Tóth
Added over 3 years ago

After installation I realised that some special character like 'ő', 'ű' displayed as '?' in MUC history.

The MySql data table muc_history and msg_history is not UTF-8. I set the tables and rows to 'utf-8-general-ci'

The online delivery okay, the special characters arrive, but the offline messages, and MUC history is still problematic.

After I set the encoding, the Web admin broke down when I try to join room, with special chars in room log. Few rows are arrive then:

'<x stamp="20150829T10:57:20"

xmlns="jabber:x:delay" from="admin@chat.medveklub.com/DESKTOP-P1LTIN2"/></message' <-broken XML content, end of response...

Non-web client connection still okay, connected, send MUC messages.

I reinstall the DB, without any content I set the encoding to utf-8

After send a special char in message at web admin muc room, I get this:

<body host="chat.medveklub.com" xmlns:stream="http://etherx.jabber.org/streams" xmlns="http://jabber

.org/protocol/httpbind" xmlns:xmpp="urn:xmpp:xbosh" secure="true" from="chat.medveklub.com" ack="9595270"

xmpp:version="1.0"><message xmlns="jabber:client" from="openroom@muc.chat.medveklub.com/tsztes" to="admin

@chat.medveklub.com/244775514-tigase-2" type="groupchat">őú<delay xmlns="urn:xmpp:delay"

stamp="2015-08-29T11:54:21Z"/></bod

the stanza is broken, and the BOSH connection stop.


Replies (2)

Added by István Tóth over 3 years ago

I fixed the database problem with this steps:

  1. (MySQL 5.5.1) Add 2 lines at etc/mysql/my.cnf

[mysqld]

character-set-server = utf8

collation-server = utf8_general_ci

  1. restart Mysql server

$ service mysql restart

3.

At mysql console (probably not necessary)

ALTER DATABASE tigasedb DEFAULT CHARACTER SET utf8

  1. I rename muc_history table to muc_history2 table just for sure

  2. restart Tigase server

  3. join a room - the muc_history table automatically created in UTF-8

All the special chars are okay

Web admin room history display still error with broken XML stanza! (you have to refresh & log in again)

Client software okay

Web client with stanza.io and websocket connection okay.

Added by Wojciech Kapcia TigaseTeam over 3 years ago

We encourage UTF8-capable MySQL configuration in the documentation: Configuring MySQL for UTF-8 Support We don't enforce UTF8 on schema level while creating schema for MUC component (it will be created as such with above config).

    (1-2/2)