I'm using this neat script for searching on my website.. but the thing is i have saved sentences with norwegian special charachters to my db, and when these are printed with this script the æ ø å's shows up like "?" instead. I am using charset=iso-8859-1 in the <head> tag
and charset=iso-8859-1 in the <script> tag
all other special characters show up as they should, its ONLY those who goes thru the search script that doesnt show up as they should.
I really hope someone understands my problem and could come with some input since i really want to use this on my site
Those characters are part of the UTF-8 charset.
PHP is known to have some problems with multibyte characters, since 1 char in PHP is represented on 1 byte.
The solution is fairly simple: change the header and content type encoding to utf-8:
Thanks for the reply!
When I did what you told me, the search part worked! I could search after special characters, and they showed up .. but all other special characters that is in my index.php suddenly went to "?".. how come? :S since they showed up when i used the iso88-59-1, they should show when i use the uft-8 too? i dont really understand why this happens?
ok. it works now i just had to close the meta tag! with a "/>".
Thanks alot!
btw..
all data that has been written in my form and sent to my database while i used the iso 8xxx charset wont come turn up as special characters when i use utf-8 ?
Depends on how it was saved in the db.
Anyway, if it turns out that the data wasn't saved OK, then modify all your forms and add this extra attribute, to make sure they will post utf-8 encoded data:
Bookmarks