|
Posted by Nis Jrgensen on 07/19/07 12:34
Matthew White skrev:
> I added that query right after calling the database, and it now works fine,
> but here is a problem- "français" returns three matches:
> français
> française
> françaises
>
> Why is "ç" being substituted for "ç", even when I pass each returned
> string
> through htmlentities()?
Htmlentities will interpret what comes from the database as iso-8859-1,
while it is in fact utf-8.
Either use
htmlentities($myvar, ENT_QUOTES, 'utf-8')
or
htmlspecialchars($myvar)
I recommend the second option - if your output is utf-8, you should
hardly ever need htmlentities.
Nis
[Back to original message]
|