phpBB2Refugees.com Logo
Not affiliated with or endorsed by the phpBB Group

Register •  Login 

Continue the legacy...

Welcome to all phpBB2 Refugees!Wave Smilie

This site is intended to continue support for the legacy 2.x line of the phpBB2 bulletin board package. If you are a fan of phpBB2, please, by all means register, post, and help us out by offering your suggestions. We are primarily a community and support network. Our secondary goal is to provide a phpBB2 MOD Author and Styles area.

phpBB2 search has a problem with special characters?


 
Search this topic... | Search phpBB2 Discussion... | Search Box
Register or Login to Post    Index » phpBB2 Discussion  Previous TopicPrint TopicNext Topic
Author Message
Holger
Board Member



Joined: 19 Jan 2009

Posts: 509
Location: Hanover


flag
PostPosted: Sun Nov 29, 2009 11:43 am 
Post subject: phpBB2 search has a problem with special characters?

Hi,

I have a strange thing going on in my forum:

when searching for the term INDUKTIONSVÄRMARE (notice the special character Ä) I get one hit, but the highlighting function says:
highlight=induktionsv%C3%84rmare (capital Ä)

When searching for INDUKTIONSVäRMARE I get three hits.
the highlighting function now says:
&highlight=induktionsv%C3%A4rmare (small ä)

Why?

/Holger
Back to top
Ptirhiik
Board Member



Joined: 19 Nov 2008

Posts: 114


flag
PostPosted: Sun Nov 29, 2009 7:26 pm 
Post subject: Re: phpBB2 search has a problem with special characters?

This is because phpBB2 does not handle correctly database encoding (as utf-8 ie), so use a default charset (ansi) with escaped chars for the database. Therefore, any char outside the ansi range will not be recognized by mysql as a letter, preventing it to deal appropriatly with lower/upper case in search.
Back to top
Holger
Board Member



Joined: 19 Jan 2009

Posts: 509
Location: Hanover


flag
PostPosted: Mon Nov 30, 2009 8:32 am 
Post subject: Re: phpBB2 search has a problem with special characters?

Is there any fix available for that?
We have a Scandinavian forum, with many special characters.
Back to top
Ptirhiik
Board Member



Joined: 19 Nov 2008

Posts: 114


flag
PostPosted: Mon Nov 30, 2009 7:19 pm 
Post subject: Re: phpBB2 search has a problem with special characters?

Not really: you have to set up the both server (apache & mysql) to work with your proper encoding, then to declare your tables with this encoding too, then to recode each posts existing as if you were editing them.
Back to top
Merri
Board Member



Joined: 02 Feb 2009

Posts: 63
Location: Kanta-Häme


flag
PostPosted: Mon Nov 30, 2009 10:56 pm 
Post subject: Re: phpBB2 search has a problem with special characters?

If you have set your page's charset as UTF-8, but the connection has been a regular unmodified phpBB MySQL connection, you have a double encoded UTF-8 issue in the database.
_________________
Comboa Twitter
Back to top
Slackervaara
Board Member



Joined: 01 Jan 2009

Posts: 70



PostPosted: Tue Dec 01, 2009 5:42 am 
Post subject: Re: phpBB2 search has a problem with special characters?

These Scandinavian letters seems to work on my site.

If I search for Ångest I get 209 hits, because it is few posts starting with capital Å.

If I search for ångest I get over 2000 hits. My webhost have Linux servers, so they are case sensitive.
Back to top
Holger
Board Member



Joined: 19 Jan 2009

Posts: 509
Location: Hanover


flag
PostPosted: Tue Dec 01, 2009 8:49 am 
Post subject: Re: phpBB2 search has a problem with special characters?

Ok ...
Back to top
arod-1
Board Member



Joined: 03 Dec 2009

Posts: 2



PostPosted: Fri Dec 04, 2009 12:38 am 
Post subject: Re: phpBB2 search has a problem with special characters?

i suspect that a very simple change would fix the problem:
in file functions_search.php, function clean_words(), find

$entry = ' ' . strip_tags(strtolower($entry)) . ' ';
and replace with
$entry = ' ' . strip_tags(mb_strtolower($entry, YOUR_ENCODING)) . ' ';

of course, replace YOUR_ENCODING with your encoding.
after doing this, you'll have to rebuild the search tables.
this solution is absolutely 100% untested. use it at your own risk. (backup blah blah blah)

this function is called before storing the strings in the search table, and again before using the search, so i *think* this solution will solve this issue.
if you actually try it, please report the results.

peace.
Back to top
Display posts from previous:   
Register or Login to Post    Index » phpBB2 Discussion  Previous TopicPrint TopicNext Topic
Page 1 of 1 All times are GMT
 
Jump to:  

Index • About • FAQ • Rules • Privacy • Search •  Register •  Login 
Not affiliated with or endorsed by the phpBB Group
Powered by phpBB2 © phpBB Group
Generated in 0.0197 seconds using 15 queries. (SQL 0.0025 Parse 0.0006 Other 0.0167)
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com Moments of Light Logo