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

Posted by Matthew White on 07/18/07 14:07

"Markus" <derernst@NO#SP#AMgmx.ch> wrote in message
news:469db6f9$1_1@news.cybercity.ch...
> Matthew White schrieb:
>
>> "Rik" <luiheidsgoeroe@hotmail.com> wrote in message
>> news:op.tvmvq3jkqnv3q9@metallium...
>>> On Tue, 17 Jul 2007 20:31:56 +0200, Matthew White <mgw854@msn.com>
>>> wrote:
>>>
>>>> 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()?
>>>
>>> Well, it's clearly not interpreted as UTF8 as it should be. Maybe use
>>> iconv to ensure all internal encoding is in utf8?
>>>
>>> http://www.php.net/iconv
>
> > I tried the iconv, both for internal and external, but to no avail. I
> > also added in the mysql_query that set UTF-8, and I have also set
> > htmlentities with the third argument of "utf-8". The output is still
> > corrupted.
>
> It looks like your string is in UTF-8 encoding, but the output is
> converted to Latin-1 or whatever. Check the following points:
>
> 1. All scripts (PHP, HTML) are in UTF-8 encoding
>
> 2. Send UTF-8 header to the browser:
> header('Content-Type: text/html; charset=UTF-8');
>
> 3. Set also the appropriate Meta tag in the HTML source (should not be
> necessary if correct header is sent, but you never know about browsers):
> <meta http-equiv="content-type" content="text/html;charset=UTF-8">
>
>
> BTW, Please get used to bottom-posting when you correspond with newsgroups
> and mailing lists (add your answer below the text you quote, rather than
> above as you do in normal e-mail).
>
> HTH
> Markus

I had already made sure of the first and last, but I did add the header() to
my PHP file. It has made no difference in the output.

Matt

 

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

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