powered by Jive Software

Cyrillic in offline messages not working

Hi everyone,

writing cyrillic messages while everyone is online works fine, but in offline messages all letters are replaced by question marks. I have taken a look into the database, table ofOffline, and there its already all in question marks. I tried converting the table to utf8, but it did not solve the problem. We use spark 2.6.3 and Openfire 3.7.1. Has anyone found a solution for this?

Thank you!

Anja

1 Like

Same problem here. Can anyone please look into this issue?

When I was on jabberd2 the same clients worked fine, now they are receiving offline messages in Cyrillic encoding only as ??? ?? ??? ???.

My server version is 3.8.2 running on Win7.

Clients include Miranda WinXP, Pidgin Win7, Kopete Fedora. All equally affected which points at the server as the culprit.

Perhaps I can give devs a hand here, if anyone can point me at the routine that is responsible for storing/forwarding offline messages, I can try to develop a fix myself.

I’ve just tried to send text in russian (copied from the web) to offline user (from Spark to Exodus and vice versa) and it comes all right when i login. I’m using the embedded database. What is your database? Maybe you need to turn on unicode support in the database. Normal messages are showing ok, because they are sent right away and not stored in the database.

Just want to make sure I understand what I need to do.

When I leave an offline message for a user, it comes across to the database as:

???????? ???????? ?????

After re-confuguring MySQL to use UTF-8 I no longer observe creation of the records in the ofoffline table

The log shows the following:

at java.lang.Thread.run(Unknown Source)

2013.09.06 10:46:11 org.jivesoftware.openfire.OfflineMessageStore - Internal server error

java.sql.SQLException: Incorrect string value: ‘\xD0\xBF\xD1\x80\xD0\xBE…’ for column ‘stanza’ at row 1

at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:946)

at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)

at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)

at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)

at com.mysql.jdbc.Connection.execSQL(Connection.java:3283)

at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1332)

at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1604)

at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1519)

at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1504)

at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at org.logicalcobwebs.proxool.ProxyStatement.invoke(ProxyStatement.java:100)

at org.logicalcobwebs.proxool.ProxyStatement.intercept(ProxyStatement.java:57)

at $java.lang.AutoCloseable$$EnhancerByProxool$$1fff3e24.executeUpdate( )

at org.jivesoftware.openfire.OfflineMessageStore.addMessage(OfflineMessageStore.ja va:164)

at org.jivesoftware.openfire.OfflineMessageStrategy.store(OfflineMessageStrategy.j ava:150)

at org.jivesoftware.openfire.OfflineMessageStrategy.storeOffline(OfflineMessageStr ategy.java:110)

at org.jivesoftware.openfire.MessageRouter.routingFailed(MessageRouter.java:203)

at org.jivesoftware.openfire.spi.RoutingTableImpl.routePacket(RoutingTableImpl.jav a:253)

at org.jivesoftware.openfire.MessageRouter.routingFailed(MessageRouter.java:200)

at org.jivesoftware.openfire.spi.RoutingTableImpl.routePacket(RoutingTableImpl.jav a:253)

at org.jivesoftware.openfire.MessageRouter.route(MessageRouter.java:109)

at org.jivesoftware.openfire.spi.PacketRouterImpl.route(PacketRouterImpl.java:80)

at org.jivesoftware.openfire.net.StanzaHandler.processMessage(StanzaHandler.java:3 73)

at org.jivesoftware.openfire.net.ClientStanzaHandler.processMessage(ClientStanzaHa ndler.java:107)

at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:227)

at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:194)

at org.jivesoftware.openfire.nio.ConnectionHandler.messageReceived(ConnectionHandl er.java:181)

at org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.messageReceived (AbstractIoFilterChain.java:570)

at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(Ab stractIoFilterChain.java:299)

at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilt erChain.java:53)

at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceive d(AbstractIoFilterChain.java:648)

at org.apache.mina.common.IoFilterAdapter.messageReceived(IoFilterAdapter.java:80)

at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(Ab stractIoFilterChain.java:299)

at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilt erChain.java:53)

at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceive d(AbstractIoFilterChain.java:648)

at org.apache.mina.filter.codec.support.SimpleProtocolDecoderOutput.flush(SimplePr otocolDecoderOutput.java:58)

at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecF ilter.java:185)

at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(Ab stractIoFilterChain.java:299)

at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilt erChain.java:53)

at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceive d(AbstractIoFilterChain.java:648)

at org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java :239)

at org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(Execut orFilter.java:283)

at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

Well, i’m not an SQL guy. I just remember other topics here about cyrillic and other chars and someone was suggesting to turn on unicode. Maybe your applications are sending text in some weird encoding. What if you just copy sime cyrillic text from the web and send? Can you try it with Spark?

Maybe related http://thejavablog.wordpress.com/2010/03/17/java-sql-sqlexception-incorrect-stri ng-value-xcfx82-xcexbcxce-for-column-body-at-row-1/

1 Like

I have no control of what clients the users choose to use but multitude of various clients running under various OSs convince me it’s not client-related.

Basically I am expected to serve them all and with jabberd2 it worked fine.

If switching to a different DB would solve it, I would proceed that route. How can I switch a DB?

In MySQL I cannot switch to unicode - utf8 is the best I could do (it has a list of native encoding and utf8 to choose from).

We are not getting vast volume of offline messages, maybe dozen a day, so I guess built-in DB should cope just fine.

I was actually referring to utf8. In that link he changes table to longtext. Maybe you need to do this too. You are still losing offline messages, so probably no harm to recreate that table.

1 Like

Don’t know how to migrate databases. But going to embedded is not the best route. DB is storing users’ rosters and other stuff, not just offline messages. And the embedded one is a very simple database in a single text file.

Could you share a script that is presently used in openfire to create ofoffline?

Never mind! Longtext with default encoding of UTF-8 worked like a charm (dunno which though). You rock!

Just a suggestion: perhaps you could modify the deployment script to include those 2 features going forward?

Great. Not sure how to put it, but i’ve tried to file this as OF-695.

1 Like

Super, thanks! Appreciate your help.