This is an improvement to PhpDig v.1.8.8 RC1 handling of Japanese full/half-width characters (thanks to Edomondo).
In config.php find:
Code:
/***********************************************************************************************************************/
//---------PATH SETTINGS
And replace with:
Code:
/***********************************************************************************************************************/
//---------CONVERT JAPANESE KANA (only for Japanese)
define('ENABLE_JPKANA',false); // activates/deactivates japanese kana conversion
define('CONVERT_JPKANA','KVa'); // see http://us2.php.net/manual/en/function.mb-convert-kana.php for options
/***********************************************************************************************************************/
//---------PATH SETTINGS
In robot_functions.php find the phpdigMakeUTF8 function.
In this function find:
Code:
if ($no_convert == 0) {
return $string;
}
else {
return 0;
}
And replace with:
Code:
if ($no_convert == 0) {
if (ENABLE_JPKANA == true) {
$string = @mb_convert_kana($string,CONVERT_JPKANA,"UTF-8");
}
return $string;
}
else {
return 0;
}
In search_functions.php find:
Code:
if (!$option) {
$option = SEARCH_DEFAULT_MODE;
}
if (!in_array($option,array('start','any','exact'))) {
return 0;
}
if ($query_string) {
$query_string = mb_eregi_replace("[?]*","",$query_string);
}
if ($query_string) {
$query_string = phpdigVerifyUTF8($query_string);
}
And replace with:
Code:
if ($query_string) {
if (ENABLE_JPKANA == true) {
$query_string = @mb_convert_kana($query_string,CONVERT_JPKANA,"UTF-8");
}
$query_string = phpdigVerifyUTF8($query_string);
}
Also in search_functions.php find:
Code:
$query_to_parse = mb_ereg_replace('&[^ ]+','',$query_to_parse); // avoid &[chars] in the query
And afterwards add:
Code:
$query_to_parse = mb_ereg_replace('[?]*','',$query_to_parse); // avoid ? in the query
If you downloaded PhpDig v.1.8.8 RC1
after the date of this post, the changes are already included in the package.