xWiki in multi languages
Hello I don't success to make my xWiki Multi Lingual. I activated in the XWiki.Preferences, paremeters sections the option Multi Lingual set to Yes. Add fr in language section with english like this : "en fr" But it doesn't add the "fr" language in the home page . I can only see "en". I modify a page but adding this '?language=fr' to the URL, it modifies the content for en too. Do you know what I did wrong ? -- Xavier MOGHRABI - Consortium ObjectWeb Email: xavier.moghrabi at objectweb.org Phone: +33 4 76 61 52 35 - Skype ID: xavier.moghrabi.bureau
Hi, The way multi lingual works, is that when you are in a document in english, you click on "Edit Fr" in the More actions menu. It will take the english content of the basis for a new document that will be the french document.. Just translate and save. It will go behind the "fr" link.. Users that arrive with a browser with the default language FR will get the french document, others will have the english one. You can navigate by clicking on the language link. Once you have clicked on a link you have a cookie that makes you by default in this language Ludovic Xavier MOGHRABI a écrit :
Hello
I don't success to make my xWiki Multi Lingual. I activated in the XWiki.Preferences, paremeters sections the option Multi Lingual set to Yes.
Add fr in language section with english like this : "en fr"
But it doesn't add the "fr" language in the home page . I can only see "en".
I modify a page but adding this '?language=fr' to the URL, it modifies the content for en too.
Do you know what I did wrong ?
Ok that's work like this, but I added vietnamese with vn code. However I can add vietnamese content, see it correctly and modify it until I flush the cache. When I Flush the cache or restart tomcat, vietnamese caracters are converted as "??????". So do you know why vietnamese characters disappear when I flush the cache ? Regards -- Xavier MOGHRABI - Consortium ObjectWeb Email: xavier.moghrabi at objectweb.org Phone: +33 4 76 61 52 35 - Skype ID: xavier.moghrabi.bureau Le jeudi 26 Mai 2005 10:10, Ludovic Dubost a écrit :
Hi,
The way multi lingual works, is that when you are in a document in english, you click on "Edit Fr" in the More actions menu. It will take the english content of the basis for a new document that will be the french document.. Just translate and save. It will go behind the "fr" link..
Users that arrive with a browser with the default language FR will get the french document, others will have the english one. You can navigate by clicking on the language link. Once you have clicked on a link you have a cookie that makes you by default in this language
Ludovic
Xavier MOGHRABI a �crit :
Hello
I don't success to make my xWiki Multi Lingual. I activated in the XWiki.Preferences, paremeters sections the option Multi Lingual set to Yes.
Add fr in language section with english like this : "en fr"
But it doesn't add the "fr" language in the home page . I can only see "en".
I modify a page but adding this '?language=fr' to the URL, it modifies the content for en too.
Do you know what I did wrong ?
I found the problem. I was using MySQL 4.0.20 and utf8 is not available. With MySQL 4.1 it works. When I create the Database I do like that : create database xwiki character set utf8; Regards -- Xavier MOGHRABI - Consortium ObjectWeb Le Jeudi 26 Mai 2005 12:25, Xavier MOGHRABI a écrit :
Ok that's work like this, but I added vietnamese with vn code.
However I can add vietnamese content, see it correctly and modify it until I flush the cache. When I Flush the cache or restart tomcat, vietnamese caracters are converted as "??????".
So do you know why vietnamese characters disappear when I flush the cache ?
Regards
No in fact it doesn't work :-( If I just create database with utf8 character set, I still have ???????? instead of chinese character when I restart Tomcat. When I start mysql with the option : mysqld --default-character-set=utf8, I have a different problem (even with an empty database). When I start xWiki, it works fine. But when I put some chinese characters and I restart tomcat, I have the error message below. It looks there is encoding error. Can someone help me ? $msg.get("problemoccured") $msg.get("detailedinformation"): Error number 3202 in 3: Exception while reading document Main.WebHome Wrapped Exception: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of com.xpn.xwiki.doc.XWikiDocument.setArchive com.xpn.xwiki.XWikiException: Error number 3202 in 3: Exception while reading document Main.WebHome Wrapped Exception: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of com.xpn.xwiki.doc.XWikiDocument.setArchive at com.xpn.xwiki.store.XWikiHibernateStore.loadXWikiDoc(XWikiHibernateStore.java:638) at com.xpn.xwiki.store.XWikiCacheStore.loadXWikiDoc(XWikiCacheStore.java:123) at com.xpn.xwiki.XWiki.getDocument(XWiki.java:566) at com.xpn.xwiki.XWiki.getDocument(XWiki.java:600) at com.xpn.xwiki.XWiki.getDocumentFromPath(XWiki.java:639) at com.xpn.xwiki.XWiki.prepareDocuments(XWiki.java:2388) at com.xpn.xwiki.web.ViewEditAction.execute(ViewEditAction.java:133) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:127) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:595) Wrapped Exception: org.hibernate.PropertyAccessException: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of com.xpn.xwiki.doc.XWikiDocument.setArchive at org.hibernate.tuple.PojoTuplizer.setPropertyValuesWithOptimizer(PojoTuplizer.java:203) at org.hibernate.tuple.PojoTuplizer.setPropertyValues(PojoTuplizer.java:173) at org.hibernate.persister.entity.BasicEntityPersister.setPropertyValues(BasicEntityPersister.java:2900) at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:113) at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:510) at org.hibernate.loader.Loader.doQuery(Loader.java:419) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:210) at org.hibernate.loader.Loader.loadEntity(Loader.java:1312) at org.hibernate.loader.entity.EntityLoader.load(EntityLoader.java:116) at org.hibernate.loader.entity.EntityLoader.load(EntityLoader.java:101) at org.hibernate.persister.entity.BasicEntityPersister.load(BasicEntityPersister.java:2461) at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:350) at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:331) at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:113) at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:167) at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:79) at org.hibernate.impl.SessionImpl.load(SessionImpl.java:588) at com.xpn.xwiki.store.XWikiHibernateStore.loadXWikiDoc(XWikiHibernateStore.java:567) at com.xpn.xwiki.store.XWikiCacheStore.loadXWikiDoc(XWikiCacheStore.java:123) at com.xpn.xwiki.XWiki.getDocument(XWiki.java:566) at com.xpn.xwiki.XWiki.getDocument(XWiki.java:600) at com.xpn.xwiki.XWiki.getDocumentFromPath(XWiki.java:639) at com.xpn.xwiki.XWiki.prepareDocuments(XWiki.java:2388) at com.xpn.xwiki.web.ViewEditAction.execute(ViewEditAction.java:133) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:127) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:595) Caused by: net.sf.cglib.beans.BulkBeanException: Lexical error at line 77, column 1. Encountered: "\u5728" (22312), after : "@\n\n\nMain\nWebHome\n\nen\n0\n\nXWiki.Admin\n1107712018000\n1117130049720\n1.10\n1 Welcome to your Wiki\n\n" at com.xpn.xwiki.doc.XWikiDocument$$BulkBeanByCGLIB$$9e5f0943.setPropertyValues() at org.hibernate.tuple.PojoTuplizer.setPropertyValuesWithOptimizer(PojoTuplizer.java:200) ... 46 more Caused by: org.apache.commons.jrcs.rcs.TokenMgrError: Lexical error at line 77, column 1. Encountered: "\u5728" (22312), after : "@\n\n\nMain\nWebHome\n\nen\n0\n\nXWiki.Admin\n1107712018000\n1117130049720\n1.10\n1 Welcome to your Wiki\n\n" at org.apache.commons.jrcs.rcs.ArchiveParserTokenManager.getNextToken(ArchiveParserTokenManager.java:800) at org.apache.commons.jrcs.rcs.ArchiveParser.jj_consume_token(ArchiveParser.java:558) at org.apache.commons.jrcs.rcs.ArchiveParser.text(ArchiveParser.java:429) at org.apache.commons.jrcs.rcs.ArchiveParser.archive(ArchiveParser.java:102) at org.apache.commons.jrcs.rcs.ArchiveParser.load(ArchiveParser.java:55) at org.apache.commons.jrcs.rcs.Archive.(Archive.java:230) at com.xpn.xwiki.doc.XWikiDocument.setArchive(XWikiDocument.java:475) ... 48 more ${doc.fullName} ($tdoc.getRealLanguage())
Hello Xavier, have you applied UTF-8 to xwiki as it is explained here ? http://www.xwiki.org/xwiki/bin/view/Dev/CharactersSets I did also set DB to UTF-8 and got into this kind of exceptions, and they vanished after I found and additionally applied the instructions above. Regards Udo Xavier MOGHRABI wrote:
No in fact it doesn't work :-(
If I just create database with utf8 character set, I still have ???????? instead of chinese character when I restart Tomcat.
When I start mysql with the option : mysqld --default-character-set=utf8, I have a different problem (even with an empty database). When I start xWiki, it works fine. But when I put some chinese characters and I restart tomcat, I have the error message below.
It looks there is encoding error. Can someone help me ?
$msg.get("problemoccured")
$msg.get("detailedinformation"):
Error number 3202 in 3: Exception while reading document Main.WebHome Wrapped Exception: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of com.xpn.xwiki.doc.XWikiDocument.setArchive com.xpn.xwiki.XWikiException: Error number 3202 in 3: Exception while reading document Main.WebHome Wrapped Exception: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of com.xpn.xwiki.doc.XWikiDocument.setArchive at com.xpn.xwiki.store.XWikiHibernateStore.loadXWikiDoc(XWikiHibernateStore.java:638) at com.xpn.xwiki.store.XWikiCacheStore.loadXWikiDoc(XWikiCacheStore.java:123) at com.xpn.xwiki.XWiki.getDocument(XWiki.java:566) at com.xpn.xwiki.XWiki.getDocument(XWiki.java:600) at com.xpn.xwiki.XWiki.getDocumentFromPath(XWiki.java:639) at com.xpn.xwiki.XWiki.prepareDocuments(XWiki.java:2388) at com.xpn.xwiki.web.ViewEditAction.execute(ViewEditAction.java:133) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:127) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:595)
Wrapped Exception:
org.hibernate.PropertyAccessException: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of com.xpn.xwiki.doc.XWikiDocument.setArchive at org.hibernate.tuple.PojoTuplizer.setPropertyValuesWithOptimizer(PojoTuplizer.java:203) at org.hibernate.tuple.PojoTuplizer.setPropertyValues(PojoTuplizer.java:173) at org.hibernate.persister.entity.BasicEntityPersister.setPropertyValues(BasicEntityPersister.java:2900) at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:113) at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:510) at org.hibernate.loader.Loader.doQuery(Loader.java:419) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:210) at org.hibernate.loader.Loader.loadEntity(Loader.java:1312) at org.hibernate.loader.entity.EntityLoader.load(EntityLoader.java:116) at org.hibernate.loader.entity.EntityLoader.load(EntityLoader.java:101) at org.hibernate.persister.entity.BasicEntityPersister.load(BasicEntityPersister.java:2461) at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:350) at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:331) at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:113) at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:167) at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:79) at org.hibernate.impl.SessionImpl.load(SessionImpl.java:588) at com.xpn.xwiki.store.XWikiHibernateStore.loadXWikiDoc(XWikiHibernateStore.java:567) at com.xpn.xwiki.store.XWikiCacheStore.loadXWikiDoc(XWikiCacheStore.java:123) at com.xpn.xwiki.XWiki.getDocument(XWiki.java:566) at com.xpn.xwiki.XWiki.getDocument(XWiki.java:600) at com.xpn.xwiki.XWiki.getDocumentFromPath(XWiki.java:639) at com.xpn.xwiki.XWiki.prepareDocuments(XWiki.java:2388) at com.xpn.xwiki.web.ViewEditAction.execute(ViewEditAction.java:133) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:127) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:595) Caused by: net.sf.cglib.beans.BulkBeanException: Lexical error at line 77, column 1. Encountered: "\u5728" (22312), after : "@\n\n\nMain\nWebHome\n\nen\n0\n\nXWiki.Admin\n1107712018000\n1117130049720\n1.10\n1 Welcome to your Wiki\n\n" at com.xpn.xwiki.doc.XWikiDocument$$BulkBeanByCGLIB$$9e5f0943.setPropertyValues() at org.hibernate.tuple.PojoTuplizer.setPropertyValuesWithOptimizer(PojoTuplizer.java:200) ... 46 more Caused by: org.apache.commons.jrcs.rcs.TokenMgrError: Lexical error at line 77, column 1. Encountered: "\u5728" (22312), after : "@\n\n\nMain\nWebHome\n\nen\n0\n\nXWiki.Admin\n1107712018000\n1117130049720\n1.10\n1 Welcome to your Wiki\n\n" at org.apache.commons.jrcs.rcs.ArchiveParserTokenManager.getNextToken(ArchiveParserTokenManager.java:800) at org.apache.commons.jrcs.rcs.ArchiveParser.jj_consume_token(ArchiveParser.java:558) at org.apache.commons.jrcs.rcs.ArchiveParser.text(ArchiveParser.java:429) at org.apache.commons.jrcs.rcs.ArchiveParser.archive(ArchiveParser.java:102) at org.apache.commons.jrcs.rcs.ArchiveParser.load(ArchiveParser.java:55) at org.apache.commons.jrcs.rcs.Archive.(Archive.java:230) at com.xpn.xwiki.doc.XWikiDocument.setArchive(XWikiDocument.java:475) ... 48 more
${doc.fullName} ($tdoc.getRealLanguage())
Le Jeudi 26 Mai 2005 20:29, Udo Bussmann a écrit :
Hello Xavier, have you applied UTF-8 to xwiki as it is explained here ? http://www.xwiki.org/xwiki/bin/view/Dev/CharactersSets
Yes, I've changed encoding in web.xml, xwiki.cfg, LANG variable and java option. For the database I try 2 ways, : 1. to set database encoding to UTF-8 by creating my database like this : create database xwiki character set utf8; It doesnt work : I have no error, it seems to work until I restart the server and my chinese characters disappear for "?" instead. 2. to change the server encoding by startiing it with this option --default-character-set=utf8 I get the last error message I posted. It's really strange. Xavier
Xavier MOGHRABI wrote:
Le Jeudi 26 Mai 2005 20:29, Udo Bussmann a écrit :
Hello Xavier, have you applied UTF-8 to xwiki as it is explained here ? http://www.xwiki.org/xwiki/bin/view/Dev/CharactersSets
Yes, I've changed encoding in web.xml, xwiki.cfg, LANG variable and java option. For the database I try 2 ways, : 1. to set database encoding to UTF-8 by creating my database like this : create database xwiki character set utf8; It doesnt work : I have no error, it seems to work until I restart the server and my chinese characters disappear for "?" instead.
2. to change the server encoding by startiing it with this option --default-character-set=utf8 I get the last error message I posted.
It's really strange.
Hi Xavier, It might be worth checking whether all character-set-* variables are correctly set to "utf8" in the MySQL variables tables. I copy below what I get when running a "SHOW VARIABLES" against a MySQL 4.1 server that I use successfully with an XWiki containing Chinese documents: | character_set_client | utf8 | character_set_connection | utf8 | character_set_database | utf8 | character_set_results | utf8 | character_set_server | utf8 | character_set_system | utf8 | character_sets_dir | /usr/share/mysql/charsets/ | collation_connection | utf8_general_ci | collation_database | utf8_general_ci | collation_server | utf8_general_ci Here is also the part of my "/etc/my.cnf" file related to charset: [client] default-character-set=utf8 [mysqld] default_character_set=utf8 Hepe this holps, Stéphane
Xavier
Hello I configure as stephane explained me. I have the good character sets in mysql : | character_set_client | utf8 | | character_set_connection | utf8 | | character_set_database | utf8 | | character_set_results | utf8 | | character_set_server | utf8 | | character_set_system | utf8 | | character_sets_dir | /usr/share/mysql/charsets/ | | collation_connection | utf8_general_ci | | collation_database | utf8_general_ci | | collation_server | utf8_general_ci | However, it still doesn't work. I have an error like this : Caused by: org.apache.commons.jrcs.rcs.TokenMgrError: Lexical error at line 37, column 2. Encountered: "\u606f" (24687), after : "@\n\n\nMain\nTest2\n\nen\n0\n\nXWiki.XWikiGuest\n1117191196650\n1117191218887\n1.2\nJe parle chinois !\n\u4fe1" at org.apache.commons.jrcs.rcs.ArchiveParserTokenManager.getNextToken(ArchiveParserTokenManager.java:800) I can see well my chinese characters. It looks like there was an error where tomcat reads them. I start Tomcat with java option : -Dfile.encoding=UTF-8 my LANG variable is fr_FR.UTF-8 (I also test en_US.UTF-8) I change encoding in web.xml and xwiki.cfg.
It might be worth checking whether all character-set-* variables are correctly set to "utf8" in the MySQL variables tables. I copy below what I get when running a "SHOW VARIABLES" against a MySQL 4.1 server that I
-- Xavier MOGHRABI - Consortium ObjectWeb Email: xavier.moghrabi at objectweb.org Phone: +33 4 76 61 52 35 - Skype ID: xavier.moghrabi.bureau
Hi Xavier, everybody, After an upgrade to XWiki 0.9.793, I actually faced the same problem as you. Strangely, I never faced the problem when running the previous release of XWiki. The problem is related to the fact that JRCS is not configured for supporting UNICODE. I have changed the "ArchiveParser.jj" file for enabling UNICODE streams (see below), and I have regenerated the parser with JavaCC, now it works better. I have uploaded the updated jars to this page: http://www.xwiki.org/xwiki/bin/view/Dev/CharactersSets org.apache.commons.jrcs.rcs.ArchiveParser.jj file: JAVA_UNICODE_ESCAPE=false; // RCS files are plain ASCII [snip] UNICODE_INPUT=false; changed to: JAVA_UNICODE_ESCAPE=true; // RCS files are plain ASCII [snip] UNICODE_INPUT=true; I have also commented out following lines of "com.xpn.xwiki.web.Utils.java", because content.length() does not return the UTF-8 encoded content length, which shortens the pages... Or converting the string to UTF-8 encoded bytes works fine, but is it absolutely necessary to set the content length of the response? if (context.getResponse() instanceof XWikiServletResponse) { response.setContentLength(content.length()); } I send the message to dev list too, as I assume the discussion should continue on that list. Stéphane Xavier MOGHRABI wrote:
Hello
I configure as stephane explained me. I have the good character sets in mysql : | character_set_client | utf8 | | character_set_connection | utf8 | | character_set_database | utf8 | | character_set_results | utf8 | | character_set_server | utf8 | | character_set_system | utf8 | | character_sets_dir | /usr/share/mysql/charsets/ | | collation_connection | utf8_general_ci | | collation_database | utf8_general_ci | | collation_server | utf8_general_ci |
However, it still doesn't work. I have an error like this : Caused by: org.apache.commons.jrcs.rcs.TokenMgrError: Lexical error at line 37, column 2. Encountered: "\u606f" (24687), after : "@\n\n\nMain\nTest2\n\nen\n0\n\nXWiki.XWikiGuest\n1117191196650\n1117191218887\n1.2\nJe parle chinois !\n\u4fe1" at org.apache.commons.jrcs.rcs.ArchiveParserTokenManager.getNextToken(ArchiveParserTokenManager.java:800)
I can see well my chinese characters. It looks like there was an error where tomcat reads them.
I start Tomcat with java option : -Dfile.encoding=UTF-8 my LANG variable is fr_FR.UTF-8 (I also test en_US.UTF-8) I change encoding in web.xml and xwiki.cfg.
It might be worth checking whether all character-set-* variables are correctly set to "utf8" in the MySQL variables tables. I copy below what I get when running a "SHOW VARIABLES" against a MySQL 4.1 server that I
Hi Stephane, I tried your package. It's better, I can have Chinese characters. However, I've got some errors when I try using some XWiki's Page. For instance, I try to reache the Class Editor and I got this error : org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getDocument' in class com.xpn.xwiki.api.XWiki threw exception class com.xpn.xwiki.XWikiException : Error number 3202 in 3: Exception while reading document XWiki.ArticleClass Wrapped Exception: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of com.xpn .xwiki.doc.XWikiDocument.setArchive at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:246) ... Regards -- Xavier MOGHRABI - Consortium ObjectWeb Email: xavier.moghrabi at objectweb.org Phone: +33 4 76 61 52 35 - Skype ID: xavier.moghrabi.bureau Le Dimanche 29 Mai 2005 15:23, Stéphane Laurière a écrit :
Hi Xavier, everybody,
After an upgrade to XWiki 0.9.793, I actually faced the same problem as you. Strangely, I never faced the problem when running the previous release of XWiki. The problem is related to the fact that JRCS is not configured for supporting UNICODE. I have changed the "ArchiveParser.jj" file for enabling UNICODE streams (see below), and I have regenerated the parser with JavaCC, now it works better. I have uploaded the updated jars to this page: http://www.xwiki.org/xwiki/bin/view/Dev/CharactersSets
org.apache.commons.jrcs.rcs.ArchiveParser.jj file:
JAVA_UNICODE_ESCAPE=false; // RCS files are plain ASCII [snip] UNICODE_INPUT=false;
changed to:
JAVA_UNICODE_ESCAPE=true; // RCS files are plain ASCII [snip] UNICODE_INPUT=true;
I have also commented out following lines of "com.xpn.xwiki.web.Utils.java", because content.length() does not return the UTF-8 encoded content length, which shortens the pages... Or converting the string to UTF-8 encoded bytes works fine, but is it absolutely necessary to set the content length of the response?
if (context.getResponse() instanceof XWikiServletResponse) { response.setContentLength(content.length()); }
I send the message to dev list too, as I assume the discussion should continue on that list.
Stéphane
Xavier MOGHRABI wrote:
Hello
I configure as stephane explained me. I have the good character sets in
mysql : | character_set_client | utf8 | | character_set_connection | utf8 | | character_set_database | utf8 | | character_set_results | utf8 | | character_set_server | utf8 | | character_set_system | utf8 | | character_sets_dir | /usr/share/mysql/charsets/ | | collation_connection | utf8_general_ci | | collation_database | utf8_general_ci | | collation_server | utf8_general_ci
However, it still doesn't work. I have an error like this : Caused by: org.apache.commons.jrcs.rcs.TokenMgrError: Lexical error at line 37, column 2. Encountered: "\u606f" (24687), after : "@\n\n\nMain\nTest2\n\nen\n0\n\nXWiki.XWikiGuest\n1117191196650\n11171912 18887\n1.2\nJe parle chinois !\n\u4fe1" at org.apache.commons.jrcs.rcs.ArchiveParserTokenManager.getNextToken(Archiv eParserTokenManager.java:800)
I can see well my chinese characters. It looks like there was an error where tomcat reads them.
I start Tomcat with java option : -Dfile.encoding=UTF-8 my LANG variable is fr_FR.UTF-8 (I also test en_US.UTF-8) I change encoding in web.xml and xwiki.cfg.
It might be worth checking whether all character-set-* variables are correctly set to "utf8" in the MySQL variables tables. I copy below what I get when running a "SHOW VARIABLES" against a MySQL 4.1 server that I
Xavier MOGHRABI wrote:
Hi Stephane,
I tried your package. It's better, I can have Chinese characters.
However, I've got some errors when I try using some XWiki's Page.
Hi Xavier, I have actually the same problem as you on some documents. I'll see ASAP what needs to be updated in the ArchiveParser.jj to fix this. Declaring the whole range of possible Unicode characters should do the trick. Cheers, Stéphane For
instance, I try to reache the Class Editor and I got this error :
org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getDocument' in class com.xpn.xwiki.api.XWiki threw exception class com.xpn.xwiki.XWikiException : Error number 3202 in 3: Exception while reading document XWiki.ArticleClass Wrapped Exception: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of com.xpn .xwiki.doc.XWikiDocument.setArchive at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:246) ...
Regards
Hello To avoid this kind errors you need to remove ISO-8859-1 characters in your database. I remove all those characters and it works fine. The xWiki's Team send also me a UTF-8 compliant database. Regards Le Mercredi 01 Juin 2005 23:30, Stéphane Laurière a écrit :
Xavier MOGHRABI wrote:
Hi Stephane,
I tried your package. It's better, I can have Chinese characters.
However, I've got some errors when I try using some XWiki's Page.
Hi Xavier,
I have actually the same problem as you on some documents. I'll see ASAP what needs to be updated in the ArchiveParser.jj to fix this. Declaring the whole range of possible Unicode characters should do the trick.
Cheers,
Stéphane
For
instance, I try to reache the Class Editor and I got this error :
org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getDocument' in class com.xpn.xwiki.api.XWiki threw exception class com.xpn.xwiki.XWikiException : Error number 3202 in 3: Exception while reading document XWiki.ArticleClass Wrapped Exception: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of com.xpn .xwiki.doc.XWikiDocument.setArchive at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java: 246) ...
Regards
On 6/2/05, Xavier MOGHRABI <[email protected]> wrote:
Hello
To avoid this kind errors you need to remove ISO-8859-1 characters in your database. I remove all those characters and it works fine. The xWiki's Team send also me a UTF-8 compliant database.
Regards
[snip] this is the UTF-8 compliant database export. there is a problem with photos attachment. If you need this I can send you tomorrow. Jérémi -- http://www.sport42.net - http://fr.runnerslifestyle.com Tel : 06.84.50.33.49 skype: jeremi23
Xavier MOGHRABI wrote:
Hello
To avoid this kind errors you need to remove ISO-8859-1 characters in your database. I remove all those characters and it works fine.
Thanks for the hint but I had a different problem, which was due to the "\u" combination described at https://javacc.dev.java.net/doc/CharStream.html I have documents describing Unix shell examples that contain such combinations and that raised errors in JRCS. Hence I have updated the "JAVA_UNICODE_ESCAPE" to "false" in the JRCS "ArchiveParser.jj" file and now it works fine. I have uploaded the changes to http://www.xwiki.org/xwiki/bin/view/Dev/CharactersSets I will create a JIRA issue about this. Cheers, Stéphane
participants (5)
-
jeremi joslin -
Ludovic Dubost -
Stéphane Laurière -
Udo Bussmann -
Xavier MOGHRABI