Reply to Re: MySQL 4.1 / PHP 5.0 : Unicode problems

Your name:

Reply:


Posted by petersprc on 10/21/06 18:21

Maybe this will help:

mysqli_set_charset('utf8');

roland.saad@gmail.com wrote:
> Hi Everyone,
>
> I have been trying to build a website that has multilingual support
> using the LAMP setup. I have created tables that store language
> information and correlate different strings ids with languages. The
> strings are all VARCHAR with unicode (utf8) encoding.
>
> I have tried all the ways that I could think of and I have checked
> every website to no avail. What I am trying to do is simply open a
> connection to the database (using mysqli) and query the tables for one
> unicode string entry. Then I call fetch_object on the result and print
> it to an HTML document. This fails with me. The characters I see are
> not unicode but either ??????? or some weird character. Aparently the
> encoding turns out to be ISO-8859-1.
>
> I have done the following:
> 1. Create the entries in the MySQL tables as unicode in InnoDB tables.
> Unicode text shows up properly in phpmyadmin.
> 2. Query correctly to the best of my knowledge using mysqli.
> 3. Add the proper header encoding to the http header and add this meta
> tag to the html:
> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
>
> Everything I have read says that this should work even though PHP is
> notorious for unicode support. What I have been able to narrow down the
> problem to is that the string that I get back from the database is
> latin encoding. I know it is unicode from MySQL (phpmyadmin), so I
> assume the problem lies in the mysqli_query function call or with the
> fetch_object call.
>
> Please help, I have been stuck on this for days now.
>
> Thanks
> Roland

[Back to original 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

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