View Full Version : Small fix for Japanese indexing

02-04-2005, 04:12 AM
Hi there.

UTF-8 compatible PhpDig is a great tool! Thank you Charter and all contributors!

Because of half-width (Hankaku) and full-width (Zenkaku) characters in Japanese, the following search won't return the same results depending on the characters used in the original page :
"999" and "999" (Half-width <> Full-Width)
"Test" and "Test" (Half-width <> Full-Width)
"アイウエオ" and "アイウエオ" (Full-width <> Half-Width)
(Sorry for those who can't read asian characters)

May I suggest to add in robot_functions.php on line 188 the following line?

$text = mb_convert_kana($text, KVa, "UTF-8");

This way, all alphanumeric full-width characters will be changed in their half-width counterparts and all half-width katakana will turn into full-width katakana.

I recommend to add this line in the future releases of PHPdig.

02-05-2005, 12:40 AM
Thanks, I posted instructions for alternative changes that you may find useful in this (http://www.phpdig.net/forum/showthread.php?p=7654#post7654) post. In order to be able to enter either half-width or full-width characters for searches, you should also make the changes to the seach_functions.php file, instructions for which are given in the aforementioned post.