Comments in Greek get saved as question marks

Hi ,

I am new to this forum , so for start I hope I am posting at the correct place.
I am having a problem with Greek fonts.
When I add a comment in a page in Greek, initially it shows up fine but when I refresh/revisit the page the characters are being replaced by question marks.
So basically I can’t use any greek in the comments.
I have enabled multilingual support and also I have made Greek my default language, all though that should be irrelevant.
I have created a demo site through xwiki.com and comments in greek work fine, so I am not quite sure what I am missing.
Any help would be much appreciated it.

Sounds like badly configured database. Make sure the database you created for XWiki is using utf8 encoding, for example in MySQL the default encoding is latin1 which does not support Greek characters.

See http://platform.xwiki.org/xwiki/bin/view/AdminGuide/InstallationWAR#HSpecificdatabasesinstructions for more details for each kind of database.

1 Like

Unfortunately that is not the case . I was hoping it would be but it is not.

show create database xwiki;
±---------±---------------------------------------------------------------+
| Database | Create Database |
±---------±---------------------------------------------------------------+
| xwiki | CREATE DATABASE xwiki /*!40100 DEFAULT CHARACTER SET utf8 */ |
±---------±---------------------------------------------------------------+

and I also checked xwikicomments table just to be on the safe side and that is also on utf8

The database is on MariaDB so Mysql.

I’d suggest you carefully check http://platform.xwiki.org/xwiki/bin/view/AdminGuide/Encoding since there are several places to configure (XWiki, dB, serviette container, web server, etc). Maybe one of them is not correctly configured in your case.

OK, in any case it definitely seems to be related to the database if it shows up correctly at the beginning and then get lost.

Maybe it’s related to your hibernate.cfg.xml file which is supposed to explicitly indicate UTF8 too.

Here is how the MySQL part looks like in the standard one:

    <property name="connection.url">jdbc:mysql://localhost/?useSSL=false</property>
    <property name="connection.username">xwiki</property>
    <property name="connection.password">xwiki</property>
    <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
    <property name="dialect">org.hibernate.dialect.MySQL5InnoDBDialect</property>
    <property name="dbcp.poolPreparedStatements">true</property>
    <property name="dbcp.maxOpenPreparedStatements">20</property>

    <property name="hibernate.connection.charSet">UTF-8</property>
    <property name="hibernate.connection.useUnicode">true</property>
    <property name="hibernate.connection.characterEncoding">utf8</property>
1 Like

That did it . It was the hibernate.cfg.xml I just added the 3 lines for the utf-8 encoding .

Thank you very much both of you, for your time and help on this issue.

Yeah I won “First Accepted Answer” badge :slight_smile: