You are here: Re: Foreign characters behaving oddly « PHP Language « IT news, forums, messages
Re: Foreign characters behaving oddly

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация