Openfire: Offline UTF-8 encoded messages are saved wrong -
use openfire 3.9.3. mysql database uses utf8_persian_ci collation , in openfire.xml have:
...<defaultprovider> <driver>com.mysql.jdbc.driver</driver> <serverurl>jdbc:mysql://localhost:3306/openfire?useunicode=true&amp;characterencoding=utf-8</serverurl> <mysql> <useunicode>true</useunicode> </mysql> ....
the problem offline messages contain persian characters (utf-8 encoded) saved strings of question marks. example سلام (means hello in persian) stored , showed ????.
mysql not have proper unicode support, makes supporting data in non-western languages difficult. however, mysql jdbc driver has workaround can enabled adding
?useunicode=true&characterencoding=utf-8&charactersetresults=utf-8
to url of jdbc driver. can edit conf/openfire.xml file add value.
note: if mechanism use configure jdbc url xml-based, need use xml character literal & separate configuration parameters, ampersand reserved character xml.
also sure db , tables have utf8 encoding.
Comments
Post a Comment