1

Topic: Russian search is not working

Can you fix this?

I set

'lang_encoding'            =>    'windows-1251',

in en_common.php and russian letters is not HTML encoded in output HTML source code.

Re: Russian search is not working

Try rebuilding your search index in admin/maintenance.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

3

Re: Russian search is not working

I resolve the problem:


// Determine what locale to use
switch (PHP_OS)
{
    case 'WINNT':
    case 'WIN32':
        $locale = 'russian';
        break;

    case 'FreeBSD':
    case 'NetBSD':
    case 'OpenBSD':
        $locale = 'ru_RU.CP1251';
        break;

    default:
        $locale = 'ru_RU';
        break;
}

// Attempt to set the locale (required for fulltext indexing to work correctly)
setlocale(LC_CTYPE, $locale);

Re: Russian search is not working

That should be in ru_common.php from the russian language packs. Isn't it there?

"Programming is like sex: one mistake and you have to support it for the rest of your life."

5

Re: Russian search is not working

Kennel wrote:

That should be in ru_common.php from the russian language packs. Isn't it there?

Yes. But I found russian language pack only for older forum version.

I use CP 1251 instead ISO8859-5 in original version.

Re: Russian search is not working

Ok, cool.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

7 (edited by zaher 2004-05-10 07:37)

Re: Russian search is not working

hi
i have same problem with Arabic but not solved,

setting Locale to arabic as above and try

search_idx.php

preg_match_all('#\b([\w]+)\b#', $text, $components);

extract English word only ,take arabic word as non charater

php version 4.3.3
punbb 1.1.4
windows 2000

If your people come crazy, you will not need to your mind any more.

Re: Russian search is not working

zaher: Are you sure the locale is getting set? Try setting it and then calling setlocale() with null for the locale parameter:

$before = setlocale(LC_ALL, null);
$after = setlocale(LC_ALL, 'your_locale_here');

Then echo out $before and $after to see if it has changed.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

9

Re: Russian search is not working

On my site Linux work good but

This test in home computer and work with win2000

$before = setlocale(LC_ALL, null);
$after = setlocale(LC_ALL, 'arabic');// or 'ar'
echo $before."\n";
echo $after."\n";

result

Arabic_Syria.1256
Arabic_Saudi Arabia.1256

but words exrtacted english only

If your people come crazy, you will not need to your mind any more.

Re: Russian search is not working

Hmm, that's odd. I honestly don't know why that happens. I guess it's a problem with the PCRE library and Windows. I'll look around and see if I can find anything.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

11

Re: Russian search is not working

Look i test it in 3 server HOME win2000, ZAHER win2000, SERVER win2003

in HOME the test.php extract english Only and PunBB also

in Server the test.php extract english but PunBB work good even if setlocal to 'en' (i am sure using this code not another by trying write an error)

in ZAHER test.php extart english words but when setlocale to 'en' not 'ar'
will extact arabic word

I WILL loose my mind &-P

If your people come crazy, you will not need to your mind any more.

Re: Russian search is not working

Let me know if you come up with something. I haven't found anything yet.

Have a look at the PHP manual page for setlocale. There are a few comments regarding Windows and non-us locales. Just ctrl+f after Windows and you will find them.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

13

Re: Russian search is not working

OK i will do.

I Have looked to it and search before post this in topic
as like i found this topic

i think its win2000 Problem.

Thanks

If your people come crazy, you will not need to your mind any more.