Jump to content


Problem with special characters (umlauts) / pulling from mysql

  • Please log in to reply
2 replies to this topic

#1 nezbie

  • Members
  • PipPipPip
  • Advanced Member
  • 31 posts
  • LocationFINLAND

Posted 27 February 2006 - 11:58 PM

Hi, I'm having some trouble pulling data from mysql via a php search script.. Shortly, in mysql, scandinavian special characters are saved by fckeditor (a wysiwyg editor) like this:

ä = ä
ö = ö

Now, when entering a search phrase to a field on my page, ofcourse I would enter something like "öland".. But when the database states this as öland, it doesn't match and no results are found.

So, simply - how to change the special characters in my search string into these "umlauts" "on fly"? - I looked at the manual and came to the conclusion and after testing, that htmlentities or such won't/wouldn't help?

Or am I completely wrong..?

thanx in advance
:: Be patient with me, I\'m new to PHP and MySQL :: :)

#2 hitman6003

  • Members
  • PipPipPip
  • Advanced Member
  • 1,807 posts

Posted 28 February 2006 - 12:07 AM

$text = str_replace("ö", "ö", $text);

Where $text is the text that contains the characters.

#3 ToonMariner

  • Members
  • PipPipPip
  • Advanced Member
  • 3,342 posts
  • LocationNewcastle upon Tyne, UK

Posted 28 February 2006 - 12:11 AM

have a look at this
[a href=\"http://uk.php.net/manual/en/function.get-html-translation-table.php\" target=\"_blank\"]php html translation table[/a]
follow me on twitter @PHPsycho

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users