Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author WebberZone

    (@webberzone)

    Hi Kan,

    Unfortunately, this is an inbuilt limitation of the FULLTEXT mySQL engine that the plugin relies on.

    https://dev.mysql.com/doc/refman/5.5/en/fulltext-restrictions.html

    Ideographic languages such as Chinese and Japanese do not have word delimiters. Therefore, the FULLTEXT parser cannot determine where words begin and end in these and other such languages. The implications of this and some workarounds for the problem are described in Section 12.9, “Full-Text Search Functions”.

    This link details a workaround, but I’m not in a position to test this.

    https://stackoverflow.com/questions/27940695/how-to-perform-mysql-fulltext-search-with-chinese-characters

    Are you in a position to edit some code of the plugin to see if this workaround helps?

    Thread Starter thebluepill8887

    (@thebluepill8887)

    Dear Author
    Thanks for the fast reply

    I thought the article said “the utf8 character set can be used” ???(12.9.5 Full-Text Restrictions)
    I can test it for you ,but I need you to provide the code and tell me where to put them .
    ??

    Plugin Author WebberZone

    (@webberzone)

    The issue from what I understand is that you have a character delimiting issue and Chinese words tend to be just one character.

    You will edit a few files for this. So, please backup any of the files that you are changing.

    Firstly in your theme’s functions.php at the very end (and before the closing ?> if it is present, add:

    function UTF2UCS($str, $s) {
        $str = strtolower($str);
        $char = 'UTF-8';
        $arr = array();
        $out = "";
        $c = mb_strlen($str,$char);
        $t = false;
    
        for($i =0;$i<$c;$i++){
            $arr[]=mb_substr($str,$i,1,$char);
        }
    
        foreach($arr as $i=>$v){
            if(preg_match('/\w/i',$v,$match)){
                $out .= $v;
                $t = true;
            }else{
                if($t) $out .= " ";
                if(isset($s) && $s) $out .= "+";
                $out .= bin2hex(iconv("UTF-8","UCS-2",$v))." ";
                $t = false;
            }
        }
        return $out;
    }

    Then before lines 408-9 which are:

    // Make sure the post is not from the future
    	$time_difference = get_option( 'gmt_offset' );

    Add:

    $stuff = UTF2UCS( $stuff, true);

    any results? it will be perfect if this plugin can work with Chinese.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Great plugin ,but needs Chinese support.’ is closed to new replies.