Re: search words containing swedish characters not working?

What does this script output?

<?php

echo 'Before: '.setlocale(LC_CTYPE, '').'<br />';
echo 'After: '.setlocale(LC_CTYPE, 'sv_SE.ISO8859-1');

?>

Try different names. E.g. sv_SE, sv, se, swedish etc.

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

27 (edited by Henke 2004-07-16 17:15)

Re: search words containing swedish characters not working?

Before: C
After: sv_SE.ISO8859-1

As I said, setlocale( LC_CTYPE, 'sv_SE.ISO8859-1' ) looks ok. But if I check again after that with setlocale(LC_CTYPE, '') it is C like before.

Thanks for helping out Rickard...

/IoR_Kongo @swec

Re: search words containing swedish characters not working?

Hmm, ok. There really isn't anything more I can do. I don't know why the locale isn't set.

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

29

Re: search words containing swedish characters not working?

yeah I understand, this is clearly not a PunBB-bug. It has something to do with FreeBSD and PHP as a combination I think.

/IoR_Kongo @swec

30 (edited by Henke 2004-07-17 12:23)

Re: search words containing swedish characters not working?

Hey, sorry for taking up your time earlier. I just rebuilt the search index and now it works.
Problem solved. roll smile

But what's strange is that the fact that setlocale can't set the locale doesn't matter for swedish åäö-searches in PunBB?

I also found a way to get the change of locale to actually work:

<?php
$locale = 'sv_SE.ISO_8859-1';
echo 'Before: '.setlocale(LC_CTYPE, '').'<br />';
putenv('LC_CTYPE='.$locale); // works for me in FreeBSD
  //echo 'New Loc: '.setlocale(LC_CTYPE, $locale).'<br />'; // not working for me
echo 'After: '.setlocale(LC_CTYPE, '');
?>

But this isn't necessary for PunBB as I said.


EDIT: I can't remember having changed language which would require rebuilding the index and whats strange is that posts after ~July 10th containing åäö was found even before rebuilding the index.

/IoR_Kongo @swec

Re: search words containing swedish characters not working?

Very odd. I honestly have no idea why that happened. Oh well, I guess it doesn't really matter seeing as it works now :)

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

Re: search words containing swedish characters not working?

I've tested with phpMyAdmin and found the same result.

for example with phpMyAdmin I tested with the query "select id, message from punbb_posts where message like 'kundjänst';" and the result is no rows. interesting.

Re: search words containing swedish characters not working?

jacobswell wrote:

I've tested with phpMyAdmin and found the same result.

for example with phpMyAdmin I tested with the query "select id, message from punbb_posts where message like 'kundjänst';" and the result is no rows. interesting.

Maybe beqause it's called "kundtjänst" ;D

Re: search words containing swedish characters not working?

It's Swidish to me!@@

Re: search words containing swedish characters not working?

LIKE 'kundtjänst' means that the message must be exactly kundtjänst. No more, no less. I think you mean LIKE '%blabla%'.

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

Re: search words containing swedish characters not working?

what i've done... fool me!