Current development on JAMWiki is primarily focused on maintenance rather than new features due to a lack of developer availability. If you are interested in working on JAMWiki please join the jamwiki-devel mailing list.

中文

Please put Chinese related problems here. 我勒个去啊,我现在都不知道该怎么新建一个我想要添加的内容,你说我得肿么办呢?

@楼上的人: 只需要访问网址:http://jamwiki.org/wiki/en/Special:Edit?topic={你的标题},就行了

@ls how to set language to zh?


Search Bug[edit]

This section is to show a bug.



Previously, I thought I found this bug, then it works fine, then it happens again, in fact, it seems that it has nothing to do with chinese, it is about the search engine, and virtual wiki, so I created another page lucene

I just found a bug, if the topic is in Chinese, then the article can not be searched. For example, this article with a topic in Chinese, then the content of this article can not be found by search.

Please search the phrase "JAMWiki in Chinese" or the word "JAMWikiinchinese", 汉字

You will see that you can not find them.

It is weird, in my server, the search engine can not find it, but here, yes, the search engine does find it.

I went to search my own wiki again, I search some English, then I search Chinese characters, it works now. Previously, when I never search English word, it doesn't show me anything when I search Chinese characters.


I am sorry that I can not reproduce the phenomenon.

other stuff about chinese[edit]

....


0.9.1[edit]

After install the completely new release 0.9.1, chinese charater is not more good. When I create a new topic with chinese name(2 characters), it seems to be OK. It is OK even with search.

But if I refresh the page, then the topic can not be found with message:

The requested value "?" was invalid. It may contain one or more characters which cannot be used in titles. 

I check database jam_topic table. The topic name, page name, page name lower are all '??'.

  1. My tomcat connector is UTF8, URIEncoding="UTF-8". This one is irrelevant for the problem. Since it is OK even with search. So Jam wiki got the topic name right and got the chinese content right. moreover, when I use preview everything is right.
  2. database is UTF8. the above mentioned 3 columns are all in utf8. This one is relevant, when the data is insert into database, it was treated as something that is not right.

But the problem is not at the db side, since I can mannualy change the topic name to chinese. then access the topic from wiki, it is OK, though the content is still '??'

So the problem is located in somewhere when the information was transferred to db. but where is it?


Another thing, even my display name which is in chinese, before refresh, it is ok. after refresh it becomes '???', I checked database, it is '???'.


where is the log, I mean I just want to check the jdbc log to find out what is passed to the database. for the database url, do we have to set ?useUnicode=true

this one doesn't change the result.


Finally, it seems the problem comes from mysql server on ubuntu after upgrade from 12.3 to 12.6, then everything is messed up. It has been reported as a bug, there are also many people were affected. The problem was found when 12.6 was released for upgrade around 4 August. the bug report.
Thanks for following up. I actually didn't look at this page (I thought it was a test page), but in the future if you report bug reports on the Bug Reports page I'll be sure to review them and try to help solve the problem. -- Ryan • (comments) • 07-Aug-2010 09:41 PDT
The ubuntu thing is fixed, the problem was due to the package manager, then I tried the wiki with chinese again. and I traced down to
AnsiQueryHandler.insertTopic(Topic topic, int virtualWikiId, Connection conn) throws SQLException 
{

..........
			stmt.setInt(index++, virtualWikiId);
System.out.println("topicName:"+topic.getName());			
			stmt.setString(index++, topic.getName());
............
}

I mean before it was inserted into Database, is it right? and the print out is good. so what might be the problem? The connection properties?

By the way, my own java program write some chinese to DB is good. jack 14-Aug-2010 23:53 PDT

Hi Jack - is the database installed with the proper character set? See Installation#UTF-8 Support. Also, I don't always look at every page that gets created on this wiki, so you might get a faster response if you use the Bug Reports and Feedback pages, which I look at a few times each day. Thanks! -- Ryan • (comments) • 15-Aug-2010 08:07 PDT
Yes, the default is UTF8. It seems that I have located the problem.

After I changed the datasource in DatabaseConnection.java

  private synchronized static void configDataSource() throws SQLException
  {
    if (dataSource != null)
    {
      closeConnectionPool(); // DataSource has already been created so remove it
    }
    String url = Environment.getValue(Environment.PROP_DB_URL);
    System.out.println(url);
    DataSource targetDataSource = null;
    if (url.startsWith("jdbc:"))
    {
      try
      {
        // Use an internal "LocalDataSource" configured from the Environment
        //targetDataSource = new LocalDataSource();
        
        InitialContext ctx;
        Context envCtx;
        
        ctx = new InitialContext();
        envCtx =  (Context) ctx.lookup("java:comp/env");
        String sDSN="db4all";
        targetDataSource  = (DataSource)envCtx.lookup(sDSN);
        
        Connection con=targetDataSource.getConnection();
        Statement stm=con.createStatement();
        String sql="insert into info_itemname values(5,'zh_CN','蕉')";
        System.out.println(sql);
        int iret=stm.executeUpdate(sql);
        System.out.println(iret);
        stm.close();      
        con.close();        

Then the above test statement is good, and the whole wiki is good with chinese character(I mean I checked jam_topic table). While I define the data source in context.xml as follows.

<Resource auth="Container" name="db4all" type="javax.sql.DataSource"
          maxActive="100" maxIdle="-1" maxWait="10000"
          driverClassName="com.mysql.jdbc.Driver"
          username="xxx" password="xxxx" 
          url="jdbc:mysql://127.0.0.1:3307/alanfruitsdb?useUnicode=true&characterEncoding=UTF-8&characterSetResults=UTF-8&autoReconnect=true"/>