stevenvh
07-08-2009, 11:31 AM
Hi,
I'm setting up a database with a text field which has to accept accented characters. Collation ascii_bin was a bad choice (obviously), so I changed it to utf8_bin.
This seemed to work; the text appears correctly when I enter it using PHPMyAdmin. But when I read the record and try to replace the accented character with the "&-something" to place in HTML, PHP doesn't seem to find it. This is what I tried:
$title = str_replace("é", "é", $title);
$title remains unchanged.
Any ideas what I'm doing wrong?
Related question: is there an elegant way to replace all accented characters in one operation, i.e. "é" by "é", "à" by "agrave", etc.?
TIA
Steven
I'm setting up a database with a text field which has to accept accented characters. Collation ascii_bin was a bad choice (obviously), so I changed it to utf8_bin.
This seemed to work; the text appears correctly when I enter it using PHPMyAdmin. But when I read the record and try to replace the accented character with the "&-something" to place in HTML, PHP doesn't seem to find it. This is what I tried:
$title = str_replace("é", "é", $title);
$title remains unchanged.
Any ideas what I'm doing wrong?
Related question: is there an elegant way to replace all accented characters in one operation, i.e. "é" by "é", "à" by "agrave", etc.?
TIA
Steven